3 #define PY_SSIZE_T_CLEAN 6 #error Python headers needed to compile C extensions, please install development version of Python. 7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 8 #error Cython requires Python 2.6+ or Python 3.3+. 10 #define CYTHON_ABI "0_28_5" 11 #define CYTHON_FUTURE_DIVISION 0 14 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 16 #if !defined(WIN32) && !defined(MS_WINDOWS) 28 #define DL_IMPORT(t) t 31 #define DL_EXPORT(t) t 34 #ifndef HAVE_LONG_LONG 35 #if PY_VERSION_HEX >= 0x02070000 36 #define HAVE_LONG_LONG 40 #define PY_LONG_LONG LONG_LONG 43 #define Py_HUGE_VAL HUGE_VAL 46 #define CYTHON_COMPILING_IN_PYPY 1 47 #define CYTHON_COMPILING_IN_PYSTON 0 48 #define CYTHON_COMPILING_IN_CPYTHON 0 49 #undef CYTHON_USE_TYPE_SLOTS 50 #define CYTHON_USE_TYPE_SLOTS 0 51 #undef CYTHON_USE_PYTYPE_LOOKUP 52 #define CYTHON_USE_PYTYPE_LOOKUP 0 53 #if PY_VERSION_HEX < 0x03050000 54 #undef CYTHON_USE_ASYNC_SLOTS 55 #define CYTHON_USE_ASYNC_SLOTS 0 56 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 57 #define CYTHON_USE_ASYNC_SLOTS 1 59 #undef CYTHON_USE_PYLIST_INTERNALS 60 #define CYTHON_USE_PYLIST_INTERNALS 0 61 #undef CYTHON_USE_UNICODE_INTERNALS 62 #define CYTHON_USE_UNICODE_INTERNALS 0 63 #undef CYTHON_USE_UNICODE_WRITER 64 #define CYTHON_USE_UNICODE_WRITER 0 65 #undef CYTHON_USE_PYLONG_INTERNALS 66 #define CYTHON_USE_PYLONG_INTERNALS 0 67 #undef CYTHON_AVOID_BORROWED_REFS 68 #define CYTHON_AVOID_BORROWED_REFS 1 69 #undef CYTHON_ASSUME_SAFE_MACROS 70 #define CYTHON_ASSUME_SAFE_MACROS 0 71 #undef CYTHON_UNPACK_METHODS 72 #define CYTHON_UNPACK_METHODS 0 73 #undef CYTHON_FAST_THREAD_STATE 74 #define CYTHON_FAST_THREAD_STATE 0 75 #undef CYTHON_FAST_PYCALL 76 #define CYTHON_FAST_PYCALL 0 77 #undef CYTHON_PEP489_MULTI_PHASE_INIT 78 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 79 #undef CYTHON_USE_TP_FINALIZE 80 #define CYTHON_USE_TP_FINALIZE 0 81 #elif defined(PYSTON_VERSION) 82 #define CYTHON_COMPILING_IN_PYPY 0 83 #define CYTHON_COMPILING_IN_PYSTON 1 84 #define CYTHON_COMPILING_IN_CPYTHON 0 85 #ifndef CYTHON_USE_TYPE_SLOTS 86 #define CYTHON_USE_TYPE_SLOTS 1 88 #undef CYTHON_USE_PYTYPE_LOOKUP 89 #define CYTHON_USE_PYTYPE_LOOKUP 0 90 #undef CYTHON_USE_ASYNC_SLOTS 91 #define CYTHON_USE_ASYNC_SLOTS 0 92 #undef CYTHON_USE_PYLIST_INTERNALS 93 #define CYTHON_USE_PYLIST_INTERNALS 0 94 #ifndef CYTHON_USE_UNICODE_INTERNALS 95 #define CYTHON_USE_UNICODE_INTERNALS 1 97 #undef CYTHON_USE_UNICODE_WRITER 98 #define CYTHON_USE_UNICODE_WRITER 0 99 #undef CYTHON_USE_PYLONG_INTERNALS 100 #define CYTHON_USE_PYLONG_INTERNALS 0 101 #ifndef CYTHON_AVOID_BORROWED_REFS 102 #define CYTHON_AVOID_BORROWED_REFS 0 104 #ifndef CYTHON_ASSUME_SAFE_MACROS 105 #define CYTHON_ASSUME_SAFE_MACROS 1 107 #ifndef CYTHON_UNPACK_METHODS 108 #define CYTHON_UNPACK_METHODS 1 110 #undef CYTHON_FAST_THREAD_STATE 111 #define CYTHON_FAST_THREAD_STATE 0 112 #undef CYTHON_FAST_PYCALL 113 #define CYTHON_FAST_PYCALL 0 114 #undef CYTHON_PEP489_MULTI_PHASE_INIT 115 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 116 #undef CYTHON_USE_TP_FINALIZE 117 #define CYTHON_USE_TP_FINALIZE 0 119 #define CYTHON_COMPILING_IN_PYPY 0 120 #define CYTHON_COMPILING_IN_PYSTON 0 121 #define CYTHON_COMPILING_IN_CPYTHON 1 122 #ifndef CYTHON_USE_TYPE_SLOTS 123 #define CYTHON_USE_TYPE_SLOTS 1 125 #if PY_VERSION_HEX < 0x02070000 126 #undef CYTHON_USE_PYTYPE_LOOKUP 127 #define CYTHON_USE_PYTYPE_LOOKUP 0 128 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 129 #define CYTHON_USE_PYTYPE_LOOKUP 1 131 #if PY_MAJOR_VERSION < 3 132 #undef CYTHON_USE_ASYNC_SLOTS 133 #define CYTHON_USE_ASYNC_SLOTS 0 134 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 135 #define CYTHON_USE_ASYNC_SLOTS 1 137 #if PY_VERSION_HEX < 0x02070000 138 #undef CYTHON_USE_PYLONG_INTERNALS 139 #define CYTHON_USE_PYLONG_INTERNALS 0 140 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 141 #define CYTHON_USE_PYLONG_INTERNALS 1 143 #ifndef CYTHON_USE_PYLIST_INTERNALS 144 #define CYTHON_USE_PYLIST_INTERNALS 1 146 #ifndef CYTHON_USE_UNICODE_INTERNALS 147 #define CYTHON_USE_UNICODE_INTERNALS 1 149 #if PY_VERSION_HEX < 0x030300F0 150 #undef CYTHON_USE_UNICODE_WRITER 151 #define CYTHON_USE_UNICODE_WRITER 0 152 #elif !defined(CYTHON_USE_UNICODE_WRITER) 153 #define CYTHON_USE_UNICODE_WRITER 1 155 #ifndef CYTHON_AVOID_BORROWED_REFS 156 #define CYTHON_AVOID_BORROWED_REFS 0 158 #ifndef CYTHON_ASSUME_SAFE_MACROS 159 #define CYTHON_ASSUME_SAFE_MACROS 1 161 #ifndef CYTHON_UNPACK_METHODS 162 #define CYTHON_UNPACK_METHODS 1 164 #ifndef CYTHON_FAST_THREAD_STATE 165 #define CYTHON_FAST_THREAD_STATE 1 167 #ifndef CYTHON_FAST_PYCALL 168 #define CYTHON_FAST_PYCALL 1 170 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 171 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) 173 #ifndef CYTHON_USE_TP_FINALIZE 174 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 177 #if !defined(CYTHON_FAST_PYCCALL) 178 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 180 #if CYTHON_USE_PYLONG_INTERNALS 181 #include "longintrepr.h" 186 #ifndef __has_attribute 187 #define __has_attribute(x) 0 189 #ifndef __has_cpp_attribute 190 #define __has_cpp_attribute(x) 0 192 #ifndef CYTHON_RESTRICT 193 #if defined(__GNUC__) 194 #define CYTHON_RESTRICT __restrict__ 195 #elif defined(_MSC_VER) && _MSC_VER >= 1400 196 #define CYTHON_RESTRICT __restrict 197 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 198 #define CYTHON_RESTRICT restrict 200 #define CYTHON_RESTRICT 203 #ifndef CYTHON_UNUSED 204 # if defined(__GNUC__) 205 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 206 # define CYTHON_UNUSED __attribute__ ((__unused__)) 208 # define CYTHON_UNUSED 210 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 211 # define CYTHON_UNUSED __attribute__ ((__unused__)) 213 # define CYTHON_UNUSED 216 #ifndef CYTHON_MAYBE_UNUSED_VAR 217 # if defined(__cplusplus) 218 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
220 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 223 #ifndef CYTHON_NCP_UNUSED 224 # if CYTHON_COMPILING_IN_CPYTHON 225 # define CYTHON_NCP_UNUSED 227 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 230 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 232 #ifndef _MSC_STDINT_H_ 234 typedef unsigned char uint8_t;
235 typedef unsigned int uint32_t;
237 typedef unsigned __int8 uint8_t;
238 typedef unsigned __int32 uint32_t;
244 #ifndef CYTHON_FALLTHROUGH 245 #if defined(__cplusplus) && __cplusplus >= 201103L 246 #if __has_cpp_attribute(fallthrough) 247 #define CYTHON_FALLTHROUGH [[fallthrough]] 248 #elif __has_cpp_attribute(clang::fallthrough) 249 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 250 #elif __has_cpp_attribute(gnu::fallthrough) 251 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 254 #ifndef CYTHON_FALLTHROUGH 255 #if __has_attribute(fallthrough) 256 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 258 #define CYTHON_FALLTHROUGH 261 #if defined(__clang__ ) && defined(__apple_build_version__) 262 #if __apple_build_version__ < 7000000 263 #undef CYTHON_FALLTHROUGH 264 #define CYTHON_FALLTHROUGH 269 #ifndef CYTHON_INLINE 270 #if defined(__clang__) 271 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 272 #elif defined(__GNUC__) 273 #define CYTHON_INLINE __inline__ 274 #elif defined(_MSC_VER) 275 #define CYTHON_INLINE __inline 276 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 277 #define CYTHON_INLINE inline 279 #define CYTHON_INLINE 283 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 284 #define Py_OptimizeFlag 0 286 #define __PYX_BUILD_PY_SSIZE_T "n" 287 #define CYTHON_FORMAT_SSIZE_T "z" 288 #if PY_MAJOR_VERSION < 3 289 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 290 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 291 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 292 #define __Pyx_DefaultClassType PyClass_Type 294 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 295 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 296 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 297 #define __Pyx_DefaultClassType PyType_Type 299 #ifndef Py_TPFLAGS_CHECKTYPES 300 #define Py_TPFLAGS_CHECKTYPES 0 302 #ifndef Py_TPFLAGS_HAVE_INDEX 303 #define Py_TPFLAGS_HAVE_INDEX 0 305 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 306 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 308 #ifndef Py_TPFLAGS_HAVE_FINALIZE 309 #define Py_TPFLAGS_HAVE_FINALIZE 0 311 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) 312 #ifndef METH_FASTCALL 313 #define METH_FASTCALL 0x80 315 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
316 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
317 Py_ssize_t nargs, PyObject *kwnames);
319 #define __Pyx_PyCFunctionFast _PyCFunctionFast 320 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 322 #if CYTHON_FAST_PYCCALL 323 #define __Pyx_PyFastCFunction_Check(func)\ 324 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) 326 #define __Pyx_PyFastCFunction_Check(func) 0 328 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 329 #define PyObject_Malloc(s) PyMem_Malloc(s) 330 #define PyObject_Free(p) PyMem_Free(p) 331 #define PyObject_Realloc(p) PyMem_Realloc(p) 333 #if CYTHON_COMPILING_IN_PYSTON 334 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 335 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 337 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 338 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 340 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 341 #define __Pyx_PyThreadState_Current PyThreadState_GET() 342 #elif PY_VERSION_HEX >= 0x03060000 343 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 344 #elif PY_VERSION_HEX >= 0x03000000 345 #define __Pyx_PyThreadState_Current PyThreadState_GET() 347 #define __Pyx_PyThreadState_Current _PyThreadState_Current 349 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) 350 #include "pythread.h" 351 #define Py_tss_NEEDS_INIT 0 352 typedef int Py_tss_t;
353 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
354 *key = PyThread_create_key();
357 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
358 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
359 *key = Py_tss_NEEDS_INIT;
362 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
365 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
366 return *key != Py_tss_NEEDS_INIT;
368 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
369 PyThread_delete_key(*key);
370 *key = Py_tss_NEEDS_INIT;
372 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
373 return PyThread_set_key_value(*key, value);
375 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
376 return PyThread_get_key_value(*key);
378 #endif // TSS (Thread Specific Storage) API 379 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 380 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 382 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 384 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 385 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 386 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 388 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 389 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 391 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS 392 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) 394 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) 396 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 397 #define CYTHON_PEP393_ENABLED 1 398 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 399 0 : _PyUnicode_Ready((PyObject *)(op))) 400 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 401 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 402 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 403 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 404 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 405 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 406 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 407 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 409 #define CYTHON_PEP393_ENABLED 0 410 #define PyUnicode_1BYTE_KIND 1 411 #define PyUnicode_2BYTE_KIND 2 412 #define PyUnicode_4BYTE_KIND 4 413 #define __Pyx_PyUnicode_READY(op) (0) 414 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 415 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 416 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 417 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 418 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 419 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 420 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 421 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 423 #if CYTHON_COMPILING_IN_PYPY 424 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 425 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 427 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 428 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 429 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 431 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 432 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 434 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 435 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 437 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 438 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 440 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 441 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 442 #if PY_MAJOR_VERSION >= 3 443 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 445 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 447 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 448 #define PyObject_ASCII(o) PyObject_Repr(o) 450 #if PY_MAJOR_VERSION >= 3 451 #define PyBaseString_Type PyUnicode_Type 452 #define PyStringObject PyUnicodeObject 453 #define PyString_Type PyUnicode_Type 454 #define PyString_Check PyUnicode_Check 455 #define PyString_CheckExact PyUnicode_CheckExact 456 #define PyObject_Unicode PyObject_Str 458 #if PY_MAJOR_VERSION >= 3 459 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 460 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 462 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 463 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 465 #ifndef PySet_CheckExact 466 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 468 #if CYTHON_ASSUME_SAFE_MACROS 469 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) 471 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) 473 #if PY_MAJOR_VERSION >= 3 474 #define PyIntObject PyLongObject 475 #define PyInt_Type PyLong_Type 476 #define PyInt_Check(op) PyLong_Check(op) 477 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 478 #define PyInt_FromString PyLong_FromString 479 #define PyInt_FromUnicode PyLong_FromUnicode 480 #define PyInt_FromLong PyLong_FromLong 481 #define PyInt_FromSize_t PyLong_FromSize_t 482 #define PyInt_FromSsize_t PyLong_FromSsize_t 483 #define PyInt_AsLong PyLong_AsLong 484 #define PyInt_AS_LONG PyLong_AS_LONG 485 #define PyInt_AsSsize_t PyLong_AsSsize_t 486 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 487 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 488 #define PyNumber_Int PyNumber_Long 490 #if PY_MAJOR_VERSION >= 3 491 #define PyBoolObject PyLongObject 493 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 494 #ifndef PyUnicode_InternFromString 495 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 498 #if PY_VERSION_HEX < 0x030200A4 499 typedef long Py_hash_t;
500 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 501 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 503 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 504 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 506 #if PY_MAJOR_VERSION >= 3 507 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) 509 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 511 #if CYTHON_USE_ASYNC_SLOTS 512 #if PY_VERSION_HEX >= 0x030500B1 513 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 514 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 516 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 519 #define __Pyx_PyType_AsAsync(obj) NULL 521 #ifndef __Pyx_PyAsyncMethodsStruct 526 } __Pyx_PyAsyncMethodsStruct;
529 #if defined(WIN32) || defined(MS_WINDOWS) 530 #define _USE_MATH_DEFINES 534 #define __PYX_NAN() ((float) NAN) 536 static CYTHON_INLINE
float __PYX_NAN() {
538 memset(&value, 0xFF,
sizeof(value));
542 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 543 #define __Pyx_truncl trunc 545 #define __Pyx_truncl truncl 549 #define __PYX_ERR(f_index, lineno, Ln_error) \ 551 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 554 #ifndef __PYX_EXTERN_C 556 #define __PYX_EXTERN_C extern "C" 558 #define __PYX_EXTERN_C extern 562 #define __PYX_HAVE__BoundaryConditions 563 #define __PYX_HAVE_API__BoundaryConditions 567 #include "numpy/arrayobject.h" 568 #include "numpy/ufuncobject.h" 569 #include "pythread.h" 576 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 577 #define CYTHON_WITHOUT_ASSERTIONS 580 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
581 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
583 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 584 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 585 #define __PYX_DEFAULT_STRING_ENCODING "" 586 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 587 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 588 #define __Pyx_uchar_cast(c) ((unsigned char)c) 589 #define __Pyx_long_cast(x) ((long)x) 590 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 591 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 592 (sizeof(type) > sizeof(Py_ssize_t) &&\ 593 likely(v < (type)PY_SSIZE_T_MAX ||\ 594 v == (type)PY_SSIZE_T_MAX) &&\ 595 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 596 v == (type)PY_SSIZE_T_MIN))) ||\ 597 (sizeof(type) == sizeof(Py_ssize_t) &&\ 598 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 599 v == (type)PY_SSIZE_T_MAX))) ) 600 #if defined (__cplusplus) && __cplusplus >= 201103L 602 #define __Pyx_sst_abs(value) std::abs(value) 603 #elif SIZEOF_INT >= SIZEOF_SIZE_T 604 #define __Pyx_sst_abs(value) abs(value) 605 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 606 #define __Pyx_sst_abs(value) labs(value) 607 #elif defined (_MSC_VER) 608 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 609 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 610 #define __Pyx_sst_abs(value) llabs(value) 611 #elif defined (__GNUC__) 612 #define __Pyx_sst_abs(value) __builtin_llabs(value) 614 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 616 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
617 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
618 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 619 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 620 #define __Pyx_PyBytes_FromString PyBytes_FromString 621 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 622 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
623 #if PY_MAJOR_VERSION < 3 624 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 627 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 628 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 630 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 631 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 632 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 633 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 634 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 635 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 636 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 637 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 638 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 639 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 640 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 641 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 642 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 643 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 644 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 645 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 646 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
647 const Py_UNICODE *u_end = u;
649 return (
size_t)(u_end - u - 1);
651 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 652 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 653 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 654 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 655 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 656 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
657 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
658 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
659 #define __Pyx_PySequence_Tuple(obj)\ 660 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 661 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
662 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
663 #if CYTHON_ASSUME_SAFE_MACROS 664 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 666 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 668 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 669 #if PY_MAJOR_VERSION >= 3 670 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 672 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 674 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 675 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 676 static int __Pyx_sys_getdefaultencoding_not_ascii;
677 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
679 PyObject* default_encoding = NULL;
680 PyObject* ascii_chars_u = NULL;
681 PyObject* ascii_chars_b = NULL;
682 const char* default_encoding_c;
683 sys = PyImport_ImportModule(
"sys");
685 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
687 if (!default_encoding)
goto bad;
688 default_encoding_c = PyBytes_AsString(default_encoding);
689 if (!default_encoding_c)
goto bad;
690 if (strcmp(default_encoding_c,
"ascii") == 0) {
691 __Pyx_sys_getdefaultencoding_not_ascii = 0;
693 char ascii_chars[128];
695 for (c = 0; c < 128; c++) {
698 __Pyx_sys_getdefaultencoding_not_ascii = 1;
699 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
700 if (!ascii_chars_u)
goto bad;
701 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
702 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
705 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
709 Py_DECREF(ascii_chars_u);
710 Py_DECREF(ascii_chars_b);
712 Py_DECREF(default_encoding);
715 Py_XDECREF(default_encoding);
716 Py_XDECREF(ascii_chars_u);
717 Py_XDECREF(ascii_chars_b);
721 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 722 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 724 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 725 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 726 static char* __PYX_DEFAULT_STRING_ENCODING;
727 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
729 PyObject* default_encoding = NULL;
730 char* default_encoding_c;
731 sys = PyImport_ImportModule(
"sys");
733 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
735 if (!default_encoding)
goto bad;
736 default_encoding_c = PyBytes_AsString(default_encoding);
737 if (!default_encoding_c)
goto bad;
738 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
739 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
740 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
741 Py_DECREF(default_encoding);
744 Py_XDECREF(default_encoding);
752 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 753 #define likely(x) __builtin_expect(!!(x), 1) 754 #define unlikely(x) __builtin_expect(!!(x), 0) 756 #define likely(x) (x) 757 #define unlikely(x) (x) 759 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
761 static PyObject *__pyx_m = NULL;
762 static PyObject *__pyx_d;
763 static PyObject *__pyx_b;
764 static PyObject *__pyx_cython_runtime = NULL;
765 static PyObject *__pyx_empty_tuple;
766 static PyObject *__pyx_empty_bytes;
767 static PyObject *__pyx_empty_unicode;
768 static int __pyx_lineno;
769 static int __pyx_clineno = 0;
770 static const char * __pyx_cfilenm= __FILE__;
771 static const char *__pyx_filename;
774 #if !defined(CYTHON_CCOMPLEX) 775 #if defined(__cplusplus) 776 #define CYTHON_CCOMPLEX 1 777 #elif defined(_Complex_I) 778 #define CYTHON_CCOMPLEX 1 780 #define CYTHON_CCOMPLEX 0 790 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) 792 #define _Complex_I 1.0fj 796 static const char *__pyx_f[] = {
798 "proteus/BoundaryConditions.py",
799 "proteus/BoundaryConditions.pxd",
800 "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd",
801 "linux2/lib/python2.7/site-packages/Cython/Includes/cpython/type.pxd",
804 struct __pyx_memoryview_obj;
806 struct __pyx_memoryview_obj *memview;
809 Py_ssize_t strides[8];
810 Py_ssize_t suboffsets[8];
811 } __Pyx_memviewslice;
812 #define __Pyx_MemoryView_Len(m) (m.shape[0]) 815 #include <pythread.h> 816 #ifndef CYTHON_ATOMICS 817 #define CYTHON_ATOMICS 1 819 #define __pyx_atomic_int_type int 820 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ 821 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ 823 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) 824 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) 825 #ifdef __PYX_DEBUG_ATOMICS 826 #warning "Using GNU atomics" 828 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 830 #undef __pyx_atomic_int_type 831 #define __pyx_atomic_int_type LONG 832 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) 833 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) 834 #ifdef __PYX_DEBUG_ATOMICS 835 #pragma message ("Using MSVC atomics") 837 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 838 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) 839 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) 840 #ifdef __PYX_DEBUG_ATOMICS 841 #warning "Using Intel atomics" 844 #undef CYTHON_ATOMICS 845 #define CYTHON_ATOMICS 0 846 #ifdef __PYX_DEBUG_ATOMICS 847 #warning "Not using atomics" 850 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
852 #define __pyx_add_acquisition_count(memview)\ 853 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) 854 #define __pyx_sub_acquisition_count(memview)\ 855 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) 857 #define __pyx_add_acquisition_count(memview)\ 858 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) 859 #define __pyx_sub_acquisition_count(memview)\ 860 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) 864 #ifndef __PYX_FORCE_INIT_THREADS 865 #define __PYX_FORCE_INIT_THREADS 0 869 #define __Pyx_PyGILState_Ensure PyGILState_Ensure 870 #define __Pyx_PyGILState_Release PyGILState_Release 871 #define __Pyx_FastGIL_Remember() 872 #define __Pyx_FastGIL_Forget() 873 #define __Pyx_FastGilFuncInit() 876 #define IS_UNSIGNED(type) (((type) -1) > 0) 877 struct __Pyx_StructField_;
878 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) 881 struct __Pyx_StructField_* fields;
889 typedef struct __Pyx_StructField_ {
890 __Pyx_TypeInfo* type;
895 __Pyx_StructField* field;
896 size_t parent_offset;
897 } __Pyx_BufFmt_StackElem;
899 __Pyx_StructField root;
900 __Pyx_BufFmt_StackElem* head;
902 size_t new_count, enc_count;
903 size_t struct_alignment;
909 } __Pyx_BufFmt_Context;
919 typedef npy_int8 __pyx_t_5numpy_int8_t;
928 typedef npy_int16 __pyx_t_5numpy_int16_t;
937 typedef npy_int32 __pyx_t_5numpy_int32_t;
946 typedef npy_int64 __pyx_t_5numpy_int64_t;
955 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
964 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
973 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
982 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
991 typedef npy_float32 __pyx_t_5numpy_float32_t;
1000 typedef npy_float64 __pyx_t_5numpy_float64_t;
1009 typedef npy_long __pyx_t_5numpy_int_t;
1018 typedef npy_longlong __pyx_t_5numpy_long_t;
1027 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1036 typedef npy_ulong __pyx_t_5numpy_uint_t;
1045 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1054 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1063 typedef npy_intp __pyx_t_5numpy_intp_t;
1072 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1081 typedef npy_double __pyx_t_5numpy_float_t;
1090 typedef npy_double __pyx_t_5numpy_double_t;
1099 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1103 typedef ::std::complex< float > __pyx_t_float_complex;
1105 typedef float _Complex __pyx_t_float_complex;
1108 typedef struct {
float real, imag; } __pyx_t_float_complex;
1110 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1115 typedef ::std::complex< double > __pyx_t_double_complex;
1117 typedef double _Complex __pyx_t_double_complex;
1120 typedef struct {
double real, imag; } __pyx_t_double_complex;
1122 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1126 struct __pyx_obj_18BoundaryConditions_BC_Base;
1127 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1128 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1129 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1130 struct __pyx_array_obj;
1131 struct __pyx_MemviewEnum_obj;
1132 struct __pyx_memoryview_obj;
1133 struct __pyx_memoryviewslice_obj;
1142 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1151 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1160 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1169 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1178 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1187 struct __pyx_obj_18BoundaryConditions_BC_Base {
1189 __Pyx_memviewslice _b_or;
1205 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1207 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1208 __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1220 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1222 PyObject *__pyx_v_value;
1232 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1234 PyObject *__pyx_v_a0;
1235 PyObject *__pyx_v_a1;
1236 PyObject *__pyx_v_i;
1247 struct __pyx_array_obj {
1249 struct __pyx_vtabstruct_array *__pyx_vtab;
1255 Py_ssize_t *_strides;
1256 Py_ssize_t itemsize;
1259 void (*callback_free_data)(
void *);
1261 int dtype_is_object;
1272 struct __pyx_MemviewEnum_obj {
1285 struct __pyx_memoryview_obj {
1287 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1290 PyObject *_array_interface;
1291 PyThread_type_lock lock;
1292 __pyx_atomic_int acquisition_count[2];
1293 __pyx_atomic_int *acquisition_count_aligned_p;
1296 int dtype_is_object;
1297 __Pyx_TypeInfo *typeinfo;
1308 struct __pyx_memoryviewslice_obj {
1309 struct __pyx_memoryview_obj __pyx_base;
1310 __Pyx_memviewslice from_slice;
1311 PyObject *from_object;
1312 PyObject *(*to_object_func)(
char *);
1313 int (*to_dtype_func)(
char *, PyObject *);
1326 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1327 void (*resetBC)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch);
1329 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1340 struct __pyx_vtabstruct_array {
1341 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1343 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1354 struct __pyx_vtabstruct_memoryview {
1355 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1356 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1357 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1358 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1359 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1360 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1361 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1363 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1374 struct __pyx_vtabstruct__memoryviewslice {
1375 struct __pyx_vtabstruct_memoryview __pyx_base;
1377 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1381 #ifndef CYTHON_REFNANNY 1382 #define CYTHON_REFNANNY 0 1386 void (*INCREF)(
void*, PyObject*, int);
1387 void (*DECREF)(
void*, PyObject*, int);
1388 void (*GOTREF)(
void*, PyObject*, int);
1389 void (*GIVEREF)(
void*, PyObject*, int);
1390 void* (*SetupContext)(
const char*, int,
const char*);
1391 void (*FinishContext)(
void**);
1392 } __Pyx_RefNannyAPIStruct;
1393 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1394 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1395 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1397 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1399 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1400 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1401 PyGILState_Release(__pyx_gilstate_save);\ 1403 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1406 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1407 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1409 #define __Pyx_RefNannyFinishContext()\ 1410 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1411 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1412 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1413 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1414 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1415 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1416 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1417 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1418 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1420 #define __Pyx_RefNannyDeclarations 1421 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1422 #define __Pyx_RefNannyFinishContext() 1423 #define __Pyx_INCREF(r) Py_INCREF(r) 1424 #define __Pyx_DECREF(r) Py_DECREF(r) 1425 #define __Pyx_GOTREF(r) 1426 #define __Pyx_GIVEREF(r) 1427 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1428 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1429 #define __Pyx_XGOTREF(r) 1430 #define __Pyx_XGIVEREF(r) 1432 #define __Pyx_XDECREF_SET(r, v) do {\ 1433 PyObject *tmp = (PyObject *) r;\ 1434 r = v; __Pyx_XDECREF(tmp);\ 1436 #define __Pyx_DECREF_SET(r, v) do {\ 1437 PyObject *tmp = (PyObject *) r;\ 1438 r = v; __Pyx_DECREF(tmp);\ 1440 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1441 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1444 #if CYTHON_USE_TYPE_SLOTS 1445 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1447 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1451 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1454 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1457 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1458 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1459 const char* function_name);
1462 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1463 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1466 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1467 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1468 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ 1469 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ 1470 __Pyx_GetItemInt_Generic(o, to_py_func(i)))) 1471 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1472 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1473 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ 1474 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) 1475 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1476 int wraparound,
int boundscheck);
1477 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1478 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1479 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ 1480 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) 1481 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1482 int wraparound,
int boundscheck);
1483 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1484 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1485 int is_list,
int wraparound,
int boundscheck);
1488 #if CYTHON_USE_TYPE_SLOTS 1489 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1491 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) 1495 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d 1496 #define __Pyx_MEMVIEW_DIRECT 1 1497 #define __Pyx_MEMVIEW_PTR 2 1498 #define __Pyx_MEMVIEW_FULL 4 1499 #define __Pyx_MEMVIEW_CONTIG 8 1500 #define __Pyx_MEMVIEW_STRIDED 16 1501 #define __Pyx_MEMVIEW_FOLLOW 32 1502 #define __Pyx_IS_C_CONTIG 1 1503 #define __Pyx_IS_F_CONTIG 2 1504 static int __Pyx_init_memviewslice(
1505 struct __pyx_memoryview_obj *memview,
1507 __Pyx_memviewslice *memviewslice,
1508 int memview_is_new_reference);
1509 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1510 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1511 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1512 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1513 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) 1514 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) 1515 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) 1516 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) 1517 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1518 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1521 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1524 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1527 #if CYTHON_FAST_PYCCALL 1528 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1530 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1534 #if CYTHON_FAST_PYCALL 1535 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1536 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1537 #if 1 || PY_VERSION_HEX < 0x030600B1 1538 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1540 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1545 #if CYTHON_COMPILING_IN_CPYTHON 1546 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1548 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1552 #if CYTHON_COMPILING_IN_CPYTHON 1553 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1557 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1560 #if CYTHON_COMPILING_IN_CPYTHON 1561 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1563 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) 1567 #if CYTHON_FAST_THREAD_STATE 1568 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1569 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1571 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1575 #if CYTHON_FAST_THREAD_STATE 1576 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1577 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1578 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1580 #define __Pyx_PyThreadState_declare 1581 #define __Pyx_PyThreadState_assign 1582 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1586 #if CYTHON_FAST_THREAD_STATE 1587 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1588 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1589 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1590 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1591 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1592 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1593 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1594 #if CYTHON_COMPILING_IN_CPYTHON 1595 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1597 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1600 #define __Pyx_PyErr_Clear() PyErr_Clear() 1601 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1602 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1603 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1604 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1605 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1606 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1607 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1611 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1614 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1617 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1620 static int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
1623 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1624 int lineno,
const char *filename,
1625 int full_traceback,
int nogil);
1628 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname);
1631 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1634 #define __Pyx_CyFunction_USED 1 1635 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 1636 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 1637 #define __Pyx_CYFUNCTION_CCLASS 0x04 1638 #define __Pyx_CyFunction_GetClosure(f)\ 1639 (((__pyx_CyFunctionObject *) (f))->func_closure) 1640 #define __Pyx_CyFunction_GetClassObj(f)\ 1641 (((__pyx_CyFunctionObject *) (f))->func_classobj) 1642 #define __Pyx_CyFunction_Defaults(type, f)\ 1643 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) 1644 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ 1645 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) 1647 PyCFunctionObject func;
1648 #if PY_VERSION_HEX < 0x030500A0 1649 PyObject *func_weakreflist;
1651 PyObject *func_dict;
1652 PyObject *func_name;
1653 PyObject *func_qualname;
1655 PyObject *func_globals;
1656 PyObject *func_code;
1657 PyObject *func_closure;
1658 PyObject *func_classobj;
1660 int defaults_pyobjects;
1662 PyObject *defaults_tuple;
1663 PyObject *defaults_kwdict;
1664 PyObject *(*defaults_getter)(PyObject *);
1665 PyObject *func_annotations;
1666 } __pyx_CyFunctionObject;
1667 static PyTypeObject *__pyx_CyFunctionType = 0;
1668 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ 1669 __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) 1670 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
1671 int flags, PyObject* qualname,
1673 PyObject *module, PyObject *globals,
1675 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1678 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1680 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1682 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1684 static int __pyx_CyFunction_init(
void);
1687 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1690 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
1693 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY 1694 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1695 #define __Pyx_PyObject_Dict_GetItem(obj, name)\ 1696 (likely(PyDict_CheckExact(obj)) ?\ 1697 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) 1699 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) 1700 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) 1704 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1707 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1710 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1713 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1716 #if CYTHON_FAST_THREAD_STATE 1717 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1718 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1719 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1720 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1722 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1723 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1727 #if CYTHON_FAST_THREAD_STATE 1728 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1729 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1731 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1735 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ 1736 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ 1737 __Pyx__ArgTypeTest(obj, type, name, exact)) 1738 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1744 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1747 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1750 #if PY_MAJOR_VERSION >= 3 1751 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals 1753 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals 1757 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1760 #define UNARY_NEG_WOULD_OVERFLOW(x)\ 1761 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) 1763 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1764 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1766 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
1768 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1770 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
1772 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1774 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
1776 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1780 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1781 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1782 const char* encoding,
const char* errors,
1783 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
1786 #if CYTHON_FAST_THREAD_STATE 1787 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) 1788 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1790 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1794 #if CYTHON_COMPILING_IN_CPYTHON 1795 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1796 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1797 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1798 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1800 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1801 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1802 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1804 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 1806 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1808 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS 1809 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1810 PyListObject* L = (PyListObject*) list;
1811 Py_ssize_t len = Py_SIZE(list);
1812 if (likely(L->allocated > len)) {
1814 PyList_SET_ITEM(list, len, x);
1815 Py_SIZE(list) = len+1;
1818 return PyList_Append(list, x);
1821 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) 1825 #if !CYTHON_COMPILING_IN_PYPY 1826 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
1828 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ 1829 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1833 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1834 #if CYTHON_COMPILING_IN_CPYTHON 1835 PyObject* none = _PyList_Extend((PyListObject*)L, v);
1836 if (unlikely(!none))
1841 return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1846 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS 1847 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1848 PyListObject* L = (PyListObject*) list;
1849 Py_ssize_t len = Py_SIZE(list);
1850 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1852 PyList_SET_ITEM(list, len, x);
1853 Py_SIZE(list) = len+1;
1856 return PyList_Append(list, x);
1859 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) 1863 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
1866 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
1869 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1870 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1872 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr 1876 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1877 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1879 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr 1883 static int __Pyx_setup_reduce(PyObject* type_obj);
1886 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1889 #ifdef CYTHON_CLINE_IN_TRACEBACK 1890 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1892 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1897 PyCodeObject* code_object;
1899 } __Pyx_CodeObjectCacheEntry;
1900 struct __Pyx_CodeObjectCache {
1903 __Pyx_CodeObjectCacheEntry* entries;
1905 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1906 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1907 static PyCodeObject *__pyx_find_code_object(
int code_line);
1908 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1911 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1912 int py_line,
const char *filename);
1914 #if PY_MAJOR_VERSION < 3 1915 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1916 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1918 #define __Pyx_GetBuffer PyObject_GetBuffer 1919 #define __Pyx_ReleaseBuffer PyBuffer_Release 1925 Py_ssize_t shape, strides, suboffsets;
1926 } __Pyx_Buf_DimInfo;
1932 __Pyx_Buffer *rcbuffer;
1934 __Pyx_Buf_DimInfo diminfo[8];
1935 } __Pyx_LocalBuf_ND;
1938 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
1941 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
1942 __Pyx_memviewslice *slice2,
1943 int ndim,
size_t itemsize);
1946 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
1949 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp);
1950 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj);
1953 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
1956 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
1957 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1958 __Pyx_BufFmt_StackElem* stack,
1959 __Pyx_TypeInfo* type);
1962 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
1965 static int __Pyx_ValidateAndInit_memviewslice(
1970 __Pyx_TypeInfo *dtype,
1971 __Pyx_BufFmt_StackElem stack[],
1972 __Pyx_memviewslice *memviewslice,
1973 PyObject *original_obj);
1976 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
1979 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1982 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1987 #define __Pyx_CREAL(z) ((z).real()) 1988 #define __Pyx_CIMAG(z) ((z).imag()) 1990 #define __Pyx_CREAL(z) (__real__(z)) 1991 #define __Pyx_CIMAG(z) (__imag__(z)) 1994 #define __Pyx_CREAL(z) ((z).real) 1995 #define __Pyx_CIMAG(z) ((z).imag) 1997 #if defined(__cplusplus) && CYTHON_CCOMPLEX\ 1998 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) 1999 #define __Pyx_SET_CREAL(z,x) ((z).real(x)) 2000 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) 2002 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) 2003 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) 2008 #define __Pyx_c_eq_float(a, b) ((a)==(b)) 2009 #define __Pyx_c_sum_float(a, b) ((a)+(b)) 2010 #define __Pyx_c_diff_float(a, b) ((a)-(b)) 2011 #define __Pyx_c_prod_float(a, b) ((a)*(b)) 2012 #define __Pyx_c_quot_float(a, b) ((a)/(b)) 2013 #define __Pyx_c_neg_float(a) (-(a)) 2015 #define __Pyx_c_is_zero_float(z) ((z)==(float)0) 2016 #define __Pyx_c_conj_float(z) (::std::conj(z)) 2018 #define __Pyx_c_abs_float(z) (::std::abs(z)) 2019 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) 2022 #define __Pyx_c_is_zero_float(z) ((z)==0) 2023 #define __Pyx_c_conj_float(z) (conjf(z)) 2025 #define __Pyx_c_abs_float(z) (cabsf(z)) 2026 #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) 2030 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2031 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2032 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2033 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2034 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2035 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2036 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2037 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2039 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2040 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2046 #define __Pyx_c_eq_double(a, b) ((a)==(b)) 2047 #define __Pyx_c_sum_double(a, b) ((a)+(b)) 2048 #define __Pyx_c_diff_double(a, b) ((a)-(b)) 2049 #define __Pyx_c_prod_double(a, b) ((a)*(b)) 2050 #define __Pyx_c_quot_double(a, b) ((a)/(b)) 2051 #define __Pyx_c_neg_double(a) (-(a)) 2053 #define __Pyx_c_is_zero_double(z) ((z)==(double)0) 2054 #define __Pyx_c_conj_double(z) (::std::conj(z)) 2056 #define __Pyx_c_abs_double(z) (::std::abs(z)) 2057 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) 2060 #define __Pyx_c_is_zero_double(z) ((z)==0) 2061 #define __Pyx_c_conj_double(z) (conj(z)) 2063 #define __Pyx_c_abs_double(z) (cabs(z)) 2064 #define __Pyx_c_pow_double(a, b) (cpow(a, b)) 2068 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2069 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2070 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2071 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2072 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2073 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2074 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2075 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2077 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2078 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2083 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
2086 static __Pyx_memviewslice
2087 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2088 const char *mode,
int ndim,
2089 size_t sizeof_dtype,
int contig_flag,
2090 int dtype_is_object);
2093 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2096 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2099 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2102 static int __Pyx_check_binary_version(
void);
2105 #if !defined(__Pyx_PyIdentifier_FromString) 2106 #if PY_MAJOR_VERSION < 3 2107 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) 2109 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) 2114 static PyObject *__Pyx_ImportModule(
const char *name);
2117 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
size_t size,
int strict);
2120 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2122 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch);
2123 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2124 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2125 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2126 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2127 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2128 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2129 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2130 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2131 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2132 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2147 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2160 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2161 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2162 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2163 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2164 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2165 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
2168 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2169 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2170 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2171 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2172 static PyTypeObject *__pyx_array_type = 0;
2173 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2174 static PyTypeObject *__pyx_memoryview_type = 0;
2175 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2176 static PyObject *
generic = 0;
2177 static PyObject *strided = 0;
2178 static PyObject *indirect = 0;
2179 static PyObject *contiguous = 0;
2180 static PyObject *indirect_contiguous = 0;
2181 static int __pyx_memoryview_thread_locks_used;
2182 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2183 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *);
2184 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2185 static void *__pyx_align_pointer(
void *,
size_t);
2186 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2187 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2188 static PyObject *_unellipsify(PyObject *,
int);
2189 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2190 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2191 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2192 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2193 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2194 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2195 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2196 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2197 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2198 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2199 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2200 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2201 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2202 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2203 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2204 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2205 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2206 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2207 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2208 static int __pyx_memoryview_err(PyObject *,
char *);
2209 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2210 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2211 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2212 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2213 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2214 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2215 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2216 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2217 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2218 #define __Pyx_MODULE_NAME "BoundaryConditions" 2219 extern int __pyx_module_is_main_BoundaryConditions;
2220 int __pyx_module_is_main_BoundaryConditions = 0;
2223 static PyObject *__pyx_builtin_TypeError;
2224 static PyObject *__pyx_builtin_ValueError;
2225 static PyObject *__pyx_builtin_range;
2226 static PyObject *__pyx_builtin_RuntimeError;
2227 static PyObject *__pyx_builtin_ImportError;
2228 static PyObject *__pyx_builtin_MemoryError;
2229 static PyObject *__pyx_builtin_enumerate;
2230 static PyObject *__pyx_builtin_Ellipsis;
2231 static PyObject *__pyx_builtin_id;
2232 static PyObject *__pyx_builtin_IndexError;
2233 static const char __pyx_k_O[] =
"O";
2234 static const char __pyx_k_c[] =
"c";
2235 static const char __pyx_k_i[] =
"i";
2236 static const char __pyx_k_t[] =
"t";
2237 static const char __pyx_k_x[] =
"x";
2238 static const char __pyx_k_a0[] =
"a0";
2239 static const char __pyx_k_a1[] =
"a1";
2240 static const char __pyx_k_id[] =
"id";
2241 static const char __pyx_k_nd[] =
"nd";
2242 static const char __pyx_k_b_i[] =
"b_i";
2243 static const char __pyx_k_get[] =
"get";
2244 static const char __pyx_k_new[] =
"__new__";
2245 static const char __pyx_k_obj[] =
"obj";
2246 static const char __pyx_k_None[] =
"None";
2247 static const char __pyx_k_b_or[] =
"b_or";
2248 static const char __pyx_k_base[] =
"base";
2249 static const char __pyx_k_dict[] =
"__dict__";
2250 static const char __pyx_k_main[] =
"__main__";
2251 static const char __pyx_k_mode[] =
"mode";
2252 static const char __pyx_k_name[] =
"name";
2253 static const char __pyx_k_ndim[] =
"ndim";
2254 static const char __pyx_k_pack[] =
"pack";
2255 static const char __pyx_k_self[] =
"self";
2256 static const char __pyx_k_size[] =
"size";
2257 static const char __pyx_k_step[] =
"step";
2258 static const char __pyx_k_stop[] =
"stop";
2259 static const char __pyx_k_test[] =
"__test__";
2260 static const char __pyx_k_ASCII[] =
"ASCII";
2261 static const char __pyx_k_class[] =
"__class__";
2262 static const char __pyx_k_error[] =
"error";
2263 static const char __pyx_k_flags[] =
"flags";
2264 static const char __pyx_k_range[] =
"range";
2265 static const char __pyx_k_shape[] =
"shape";
2266 static const char __pyx_k_start[] =
"start";
2267 static const char __pyx_k_state[] =
"state";
2268 static const char __pyx_k_value[] =
"value";
2269 static const char __pyx_k_Domain[] =
"Domain";
2270 static const char __pyx_k_dict_2[] =
"_dict";
2271 static const char __pyx_k_encode[] =
"encode";
2272 static const char __pyx_k_format[] =
"format";
2273 static const char __pyx_k_import[] =
"__import__";
2274 static const char __pyx_k_name_2[] =
"__name__";
2275 static const char __pyx_k_pickle[] =
"pickle";
2276 static const char __pyx_k_reduce[] =
"__reduce__";
2277 static const char __pyx_k_struct[] =
"struct";
2278 static const char __pyx_k_unpack[] =
"unpack";
2279 static const char __pyx_k_update[] =
"update";
2280 static const char __pyx_k_Context[] =
"Context";
2281 static const char __pyx_k_context[] =
"context";
2282 static const char __pyx_k_fortran[] =
"fortran";
2283 static const char __pyx_k_memview[] =
"memview";
2284 static const char __pyx_k_proteus[] =
"proteus";
2285 static const char __pyx_k_resetBC[] =
"resetBC";
2286 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2287 static const char __pyx_k_getstate[] =
"__getstate__";
2288 static const char __pyx_k_itemsize[] =
"itemsize";
2289 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2290 static const char __pyx_k_setstate[] =
"__setstate__";
2291 static const char __pyx_k_TypeError[] =
"TypeError";
2292 static const char __pyx_k_enumerate[] =
"enumerate";
2293 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2294 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2295 static const char __pyx_k_IndexError[] =
"IndexError";
2296 static const char __pyx_k_ValueError[] =
"ValueError";
2297 static const char __pyx_k_getContext[] =
"getContext";
2298 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2299 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2300 static const char __pyx_k_ImportError[] =
"ImportError";
2301 static const char __pyx_k_MemoryError[] =
"MemoryError";
2302 static const char __pyx_k_PickleError[] =
"PickleError";
2303 static const char __pyx_k_init_cython[] =
"init_cython";
2304 static const char __pyx_k_setLinearBC[] =
"setLinearBC";
2305 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2306 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2307 static const char __pyx_k_stringsource[] =
"stringsource";
2308 static const char __pyx_k_use_setstate[] =
"use_setstate";
2309 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2310 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2311 static const char __pyx_k_setConstantBC[] =
"setConstantBC";
2312 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2313 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2314 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2315 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2316 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2317 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2318 static const char __pyx_k_BC_Base_getContext[] =
"BC_Base.getContext";
2319 static const char __pyx_k_BoundaryConditions[] =
"BoundaryConditions";
2320 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2321 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2322 static const char __pyx_k_pyx_unpickle_BC_Base[] =
"__pyx_unpickle_BC_Base";
2323 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2324 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2325 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2326 static const char __pyx_k_BC_Base___reduce_cython[] =
"BC_Base.__reduce_cython__";
2327 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2328 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2329 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2330 static const char __pyx_k_BC_Base___setstate_cython[] =
"BC_Base.__setstate_cython__";
2331 static const char __pyx_k_BoundaryCondition_resetBC[] =
"BoundaryCondition.resetBC";
2332 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2333 static const char __pyx_k_setLinearBC_locals_lambda[] =
"setLinearBC.<locals>.<lambda>";
2334 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2335 static const char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
2336 static const char __pyx_k_setConstantBC_locals_lambda[] =
"setConstantBC.<locals>.<lambda>";
2337 static const char __pyx_k_BoundaryCondition_init_cython[] =
"BoundaryCondition.init_cython";
2338 static const char __pyx_k_BoundaryCondition_setLinearBC[] =
"BoundaryCondition.setLinearBC";
2339 static const char __pyx_k_proteus_BoundaryConditions_py[] =
"proteus/BoundaryConditions.py";
2340 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2341 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2342 static const char __pyx_k_BoundaryCondition_setConstantBC[] =
"BoundaryCondition.setConstantBC";
2343 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2344 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] =
"self.uuOfXT cannot be converted to a Python object for pickling";
2345 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
2346 static const char __pyx_k_BoundaryCondition___reduce_cytho[] =
"BoundaryCondition.__reduce_cython__";
2347 static const char __pyx_k_BoundaryCondition___setstate_cyt[] =
"BoundaryCondition.__setstate_cython__";
2348 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2349 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2350 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2351 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2352 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2353 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
2354 static const char __pyx_k_Incompatible_checksums_s_vs_0x96[] =
"Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))";
2355 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] =
"Incompatible checksums (%s vs 0xb068931 = (name))";
2356 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2357 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2358 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
2359 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2360 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] =
"Shape or nd must be passed to BC";
2361 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2362 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2363 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
2364 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2365 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2366 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2367 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
2368 static PyObject *__pyx_n_s_ASCII;
2369 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2370 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2371 static PyObject *__pyx_n_s_BC_Base_getContext;
2372 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2373 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2374 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2375 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2376 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2377 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2378 static PyObject *__pyx_n_s_BoundaryConditions;
2379 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2380 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2381 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2382 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2383 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2384 static PyObject *__pyx_n_s_Context;
2385 static PyObject *__pyx_n_s_Domain;
2386 static PyObject *__pyx_n_s_Ellipsis;
2387 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2388 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2389 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2390 static PyObject *__pyx_n_s_ImportError;
2391 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x96;
2392 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2393 static PyObject *__pyx_n_s_IndexError;
2394 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2395 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2396 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2397 static PyObject *__pyx_n_s_MemoryError;
2398 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2399 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2400 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2401 static PyObject *__pyx_n_s_None;
2402 static PyObject *__pyx_n_b_O;
2403 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2404 static PyObject *__pyx_n_s_PickleError;
2405 static PyObject *__pyx_n_s_RuntimeError;
2406 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2407 static PyObject *__pyx_n_s_TypeError;
2408 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2409 static PyObject *__pyx_n_s_ValueError;
2410 static PyObject *__pyx_n_s_View_MemoryView;
2411 static PyObject *__pyx_n_s_a0;
2412 static PyObject *__pyx_n_s_a1;
2413 static PyObject *__pyx_n_s_allocate_buffer;
2414 static PyObject *__pyx_n_s_b_i;
2415 static PyObject *__pyx_n_s_b_or;
2416 static PyObject *__pyx_n_s_base;
2417 static PyObject *__pyx_n_s_c;
2418 static PyObject *__pyx_n_u_c;
2419 static PyObject *__pyx_n_s_class;
2420 static PyObject *__pyx_n_s_cline_in_traceback;
2421 static PyObject *__pyx_n_s_context;
2422 static PyObject *__pyx_kp_s_contiguous_and_direct;
2423 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2424 static PyObject *__pyx_n_s_dict;
2425 static PyObject *__pyx_n_s_dict_2;
2426 static PyObject *__pyx_n_s_dtype_is_object;
2427 static PyObject *__pyx_n_s_encode;
2428 static PyObject *__pyx_n_s_enumerate;
2429 static PyObject *__pyx_n_s_error;
2430 static PyObject *__pyx_n_s_flags;
2431 static PyObject *__pyx_n_s_format;
2432 static PyObject *__pyx_n_s_fortran;
2433 static PyObject *__pyx_n_u_fortran;
2434 static PyObject *__pyx_n_s_get;
2435 static PyObject *__pyx_n_s_getContext;
2436 static PyObject *__pyx_n_s_getstate;
2437 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2438 static PyObject *__pyx_n_s_i;
2439 static PyObject *__pyx_n_s_id;
2440 static PyObject *__pyx_n_s_import;
2441 static PyObject *__pyx_n_s_init_cython;
2442 static PyObject *__pyx_n_s_itemsize;
2443 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2444 static PyObject *__pyx_n_s_main;
2445 static PyObject *__pyx_n_s_memview;
2446 static PyObject *__pyx_n_s_mode;
2447 static PyObject *__pyx_n_s_name;
2448 static PyObject *__pyx_n_s_name_2;
2449 static PyObject *__pyx_n_s_nd;
2450 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2451 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2452 static PyObject *__pyx_n_s_ndim;
2453 static PyObject *__pyx_n_s_new;
2454 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2455 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2456 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2457 static PyObject *__pyx_n_s_obj;
2458 static PyObject *__pyx_n_s_pack;
2459 static PyObject *__pyx_n_s_pickle;
2460 static PyObject *__pyx_n_s_proteus;
2461 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2462 static PyObject *__pyx_n_s_pyx_PickleError;
2463 static PyObject *__pyx_n_s_pyx_checksum;
2464 static PyObject *__pyx_n_s_pyx_getbuffer;
2465 static PyObject *__pyx_n_s_pyx_result;
2466 static PyObject *__pyx_n_s_pyx_state;
2467 static PyObject *__pyx_n_s_pyx_type;
2468 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2469 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2470 static PyObject *__pyx_n_s_pyx_vtable;
2471 static PyObject *__pyx_n_s_range;
2472 static PyObject *__pyx_n_s_reduce;
2473 static PyObject *__pyx_n_s_reduce_cython;
2474 static PyObject *__pyx_n_s_reduce_ex;
2475 static PyObject *__pyx_n_s_resetBC;
2476 static PyObject *__pyx_n_s_self;
2477 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2478 static PyObject *__pyx_n_s_setConstantBC;
2479 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2480 static PyObject *__pyx_n_s_setLinearBC;
2481 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2482 static PyObject *__pyx_n_s_setstate;
2483 static PyObject *__pyx_n_s_setstate_cython;
2484 static PyObject *__pyx_n_s_shape;
2485 static PyObject *__pyx_n_s_size;
2486 static PyObject *__pyx_n_s_start;
2487 static PyObject *__pyx_n_s_state;
2488 static PyObject *__pyx_n_s_step;
2489 static PyObject *__pyx_n_s_stop;
2490 static PyObject *__pyx_kp_s_strided_and_direct;
2491 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2492 static PyObject *__pyx_kp_s_strided_and_indirect;
2493 static PyObject *__pyx_kp_s_stringsource;
2494 static PyObject *__pyx_n_s_struct;
2495 static PyObject *__pyx_n_s_t;
2496 static PyObject *__pyx_n_s_test;
2497 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2498 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2499 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2500 static PyObject *__pyx_n_s_unpack;
2501 static PyObject *__pyx_n_s_update;
2502 static PyObject *__pyx_n_s_use_setstate;
2503 static PyObject *__pyx_n_s_value;
2504 static PyObject *__pyx_n_s_x;
2505 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd);
2506 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context);
2507 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2508 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2509 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2510 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2511 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2512 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2513 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2514 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2515 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2516 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2517 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2518 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2519 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2520 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2521 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2522 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2523 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2524 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2525 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2526 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t);
2527 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
2528 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t);
2529 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a1, PyObject *__pyx_v_i);
2530 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2531 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
2532 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2533 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2534 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2535 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2536 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2537 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
2538 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2539 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2540 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2541 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2542 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2543 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2544 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2545 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2546 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2547 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2548 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2549 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2550 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2551 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2552 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2553 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2554 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2555 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2556 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2557 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2558 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2559 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2560 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2561 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2562 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2563 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2564 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2565 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2566 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2567 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2568 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2569 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2570 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2571 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2572 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2573 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2574 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2575 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2576 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2577 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2578 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2579 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2580 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k);
2581 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k);
2582 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k);
2583 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k);
2584 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2585 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2586 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2587 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2588 static PyObject *__pyx_int_0;
2589 static PyObject *__pyx_int_1;
2590 static PyObject *__pyx_int_158231071;
2591 static PyObject *__pyx_int_184977713;
2592 static PyObject *__pyx_int_neg_1;
2593 static PyObject *__pyx_tuple_;
2594 static PyObject *__pyx_tuple__2;
2595 static PyObject *__pyx_tuple__3;
2596 static PyObject *__pyx_tuple__4;
2597 static PyObject *__pyx_tuple__5;
2598 static PyObject *__pyx_tuple__6;
2599 static PyObject *__pyx_tuple__7;
2600 static PyObject *__pyx_tuple__8;
2601 static PyObject *__pyx_tuple__9;
2602 static PyObject *__pyx_slice__27;
2603 static PyObject *__pyx_slice__28;
2604 static PyObject *__pyx_slice__29;
2605 static PyObject *__pyx_tuple__10;
2606 static PyObject *__pyx_tuple__11;
2607 static PyObject *__pyx_tuple__12;
2608 static PyObject *__pyx_tuple__13;
2609 static PyObject *__pyx_tuple__14;
2610 static PyObject *__pyx_tuple__15;
2611 static PyObject *__pyx_tuple__16;
2612 static PyObject *__pyx_tuple__17;
2613 static PyObject *__pyx_tuple__18;
2614 static PyObject *__pyx_tuple__19;
2615 static PyObject *__pyx_tuple__20;
2616 static PyObject *__pyx_tuple__21;
2617 static PyObject *__pyx_tuple__22;
2618 static PyObject *__pyx_tuple__23;
2619 static PyObject *__pyx_tuple__24;
2620 static PyObject *__pyx_tuple__25;
2621 static PyObject *__pyx_tuple__26;
2622 static PyObject *__pyx_tuple__30;
2623 static PyObject *__pyx_tuple__31;
2624 static PyObject *__pyx_tuple__32;
2625 static PyObject *__pyx_tuple__33;
2626 static PyObject *__pyx_tuple__35;
2627 static PyObject *__pyx_tuple__37;
2628 static PyObject *__pyx_tuple__39;
2629 static PyObject *__pyx_tuple__41;
2630 static PyObject *__pyx_tuple__43;
2631 static PyObject *__pyx_tuple__45;
2632 static PyObject *__pyx_tuple__47;
2633 static PyObject *__pyx_tuple__49;
2634 static PyObject *__pyx_tuple__51;
2635 static PyObject *__pyx_tuple__53;
2636 static PyObject *__pyx_tuple__54;
2637 static PyObject *__pyx_tuple__55;
2638 static PyObject *__pyx_tuple__56;
2639 static PyObject *__pyx_tuple__57;
2640 static PyObject *__pyx_tuple__58;
2641 static PyObject *__pyx_codeobj__34;
2642 static PyObject *__pyx_codeobj__36;
2643 static PyObject *__pyx_codeobj__38;
2644 static PyObject *__pyx_codeobj__40;
2645 static PyObject *__pyx_codeobj__42;
2646 static PyObject *__pyx_codeobj__44;
2647 static PyObject *__pyx_codeobj__46;
2648 static PyObject *__pyx_codeobj__48;
2649 static PyObject *__pyx_codeobj__50;
2650 static PyObject *__pyx_codeobj__52;
2651 static PyObject *__pyx_codeobj__59;
2663 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2664 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2665 PyObject *__pyx_v_shape = 0;
2666 PyObject *__pyx_v_name = 0;
2667 PyObject *__pyx_v_b_or = 0;
2668 PyObject *__pyx_v_b_i = 0;
2669 PyObject *__pyx_v_nd = 0;
2671 __Pyx_RefNannyDeclarations
2672 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
2674 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
2675 PyObject* values[5] = {0,0,0,0,0};
2676 values[0] = ((PyObject *)Py_None);
2677 values[1] = ((PyObject *)Py_None);
2678 values[2] = ((PyObject *)Py_None);
2679 values[3] = ((PyObject *)__pyx_int_0);
2680 values[4] = ((PyObject *)Py_None);
2681 if (unlikely(__pyx_kwds)) {
2683 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2685 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2687 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2689 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2691 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2693 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2696 default:
goto __pyx_L5_argtuple_error;
2698 kw_args = PyDict_Size(__pyx_kwds);
2702 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
2703 if (value) { values[0] = value; kw_args--; }
2708 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
2709 if (value) { values[1] = value; kw_args--; }
2714 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
2715 if (value) { values[2] = value; kw_args--; }
2720 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
2721 if (value) { values[3] = value; kw_args--; }
2726 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
2727 if (value) { values[4] = value; kw_args--; }
2730 if (unlikely(kw_args > 0)) {
2731 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 13, __pyx_L3_error)
2734 switch (PyTuple_GET_SIZE(__pyx_args)) {
2735 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2737 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2739 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2741 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2743 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2746 default:
goto __pyx_L5_argtuple_error;
2749 __pyx_v_shape = values[0];
2750 __pyx_v_name = values[1];
2751 __pyx_v_b_or = values[2];
2752 __pyx_v_b_i = values[3];
2753 __pyx_v_nd = values[4];
2755 goto __pyx_L4_argument_unpacking_done;
2756 __pyx_L5_argtuple_error:;
2757 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 13, __pyx_L3_error)
2759 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2760 __Pyx_RefNannyFinishContext();
2762 __pyx_L4_argument_unpacking_done:;
2763 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
2766 __Pyx_RefNannyFinishContext();
2770 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
2772 __Pyx_RefNannyDeclarations
2773 PyObject *__pyx_t_1 = NULL;
2776 PyObject *__pyx_t_4 = NULL;
2778 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
2779 __Pyx_RefNannySetupContext(
"__init__", 0);
2788 __Pyx_INCREF(__pyx_v_shape);
2789 __Pyx_GIVEREF(__pyx_v_shape);
2790 __Pyx_GOTREF(__pyx_v_self->Shape);
2791 __Pyx_DECREF(__pyx_v_self->Shape);
2792 __pyx_v_self->Shape = __pyx_v_shape;
2801 if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
2802 __pyx_t_1 = __pyx_v_name;
2803 __Pyx_INCREF(__pyx_t_1);
2804 __Pyx_GIVEREF(__pyx_t_1);
2805 __Pyx_GOTREF(__pyx_v_self->name);
2806 __Pyx_DECREF(__pyx_v_self->name);
2807 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
2817 __Pyx_INCREF(__pyx_n_s_None);
2818 __Pyx_GIVEREF(__pyx_n_s_None);
2819 __Pyx_GOTREF(__pyx_v_self->BC_type);
2820 __Pyx_DECREF(__pyx_v_self->BC_type);
2821 __pyx_v_self->BC_type = __pyx_n_s_None;
2830 __pyx_t_2 = (__pyx_v_shape != Py_None);
2831 __pyx_t_3 = (__pyx_t_2 != 0);
2841 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error)
2842 __Pyx_GOTREF(__pyx_t_1);
2843 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 18, __pyx_L1_error)
2844 __Pyx_GOTREF(__pyx_t_4);
2845 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2846 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 18, __pyx_L1_error)
2847 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2848 __pyx_v_self->nd = __pyx_t_5;
2867 __pyx_t_3 = (__pyx_v_nd != Py_None);
2868 __pyx_t_2 = (__pyx_t_3 != 0);
2878 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 20, __pyx_L1_error)
2879 __pyx_v_self->nd = __pyx_t_5;
2899 #ifndef CYTHON_WITHOUT_ASSERTIONS 2900 if (unlikely(!Py_OptimizeFlag)) {
2901 __pyx_t_2 = (__pyx_v_nd != Py_None);
2902 if (unlikely(!(__pyx_t_2 != 0))) {
2903 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
2904 __PYX_ERR(1, 22, __pyx_L1_error)
2918 __pyx_t_2 = (__pyx_v_b_or != Py_None);
2919 __pyx_t_3 = (__pyx_t_2 != 0);
2929 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 24, __pyx_L1_error)
2930 __Pyx_GOTREF(__pyx_t_4);
2931 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(1, 24, __pyx_L1_error)
2932 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2933 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
2934 __pyx_v_self->_b_or = __pyx_t_6;
2935 __pyx_t_6.memview = NULL;
2936 __pyx_t_6.data = NULL;
2956 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(1, 26, __pyx_L1_error)
2957 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
2958 __pyx_v_self->_b_or = __pyx_t_6;
2959 __pyx_t_6.memview = NULL;
2960 __pyx_t_6.data = NULL;
2976 __Pyx_XDECREF(__pyx_t_1);
2977 __Pyx_XDECREF(__pyx_t_4);
2978 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
2979 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2982 __Pyx_RefNannyFinishContext();
2995 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2996 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] =
"\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
2997 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {
"getContext", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
2998 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2999 PyObject *__pyx_v_context = 0;
3000 PyObject *__pyx_r = 0;
3001 __Pyx_RefNannyDeclarations
3002 __Pyx_RefNannySetupContext(
"getContext (wrapper)", 0);
3004 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3005 PyObject* values[1] = {0};
3006 values[0] = ((PyObject *)Py_None);
3007 if (unlikely(__pyx_kwds)) {
3009 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3011 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3014 default:
goto __pyx_L5_argtuple_error;
3016 kw_args = PyDict_Size(__pyx_kwds);
3020 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3021 if (value) { values[0] = value; kw_args--; }
3024 if (unlikely(kw_args > 0)) {
3025 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getContext") < 0)) __PYX_ERR(1, 41, __pyx_L3_error)
3028 switch (PyTuple_GET_SIZE(__pyx_args)) {
3029 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3032 default:
goto __pyx_L5_argtuple_error;
3035 __pyx_v_context = values[0];
3037 goto __pyx_L4_argument_unpacking_done;
3038 __pyx_L5_argtuple_error:;
3039 __Pyx_RaiseArgtupleInvalid(
"getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 41, __pyx_L3_error)
3041 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3042 __Pyx_RefNannyFinishContext();
3044 __pyx_L4_argument_unpacking_done:;
3045 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3048 __Pyx_RefNannyFinishContext();
3052 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3053 PyObject *__pyx_v_Context = NULL;
3054 PyObject *__pyx_r = NULL;
3055 __Pyx_RefNannyDeclarations
3057 PyObject *__pyx_t_2 = NULL;
3058 PyObject *__pyx_t_3 = NULL;
3059 PyObject *__pyx_t_4 = NULL;
3060 __Pyx_RefNannySetupContext(
"getContext", 0);
3069 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 50, __pyx_L1_error)
3079 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error)
3080 __Pyx_GOTREF(__pyx_t_2);
3081 __Pyx_INCREF(__pyx_n_s_Context);
3082 __Pyx_GIVEREF(__pyx_n_s_Context);
3083 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3084 __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 51, __pyx_L1_error)
3085 __Pyx_GOTREF(__pyx_t_3);
3086 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3087 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error)
3088 __Pyx_GOTREF(__pyx_t_2);
3089 __Pyx_INCREF(__pyx_t_2);
3090 __pyx_v_Context = __pyx_t_2;
3091 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3092 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3101 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error)
3102 __Pyx_GOTREF(__pyx_t_2);
3104 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3105 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3106 if (likely(__pyx_t_4)) {
3107 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3108 __Pyx_INCREF(__pyx_t_4);
3109 __Pyx_INCREF(
function);
3110 __Pyx_DECREF_SET(__pyx_t_2,
function);
3114 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L1_error)
3115 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3117 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L1_error)
3119 __Pyx_GOTREF(__pyx_t_3);
3120 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3121 __Pyx_GIVEREF(__pyx_t_3);
3122 __Pyx_GOTREF(__pyx_v_self->ct);
3123 __Pyx_DECREF(__pyx_v_self->ct);
3124 __pyx_v_self->ct = __pyx_t_3;
3145 __Pyx_INCREF(__pyx_v_context);
3146 __Pyx_GIVEREF(__pyx_v_context);
3147 __Pyx_GOTREF(__pyx_v_self->ct);
3148 __Pyx_DECREF(__pyx_v_self->ct);
3149 __pyx_v_self->ct = __pyx_v_context;
3162 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3165 __Pyx_XDECREF(__pyx_t_2);
3166 __Pyx_XDECREF(__pyx_t_3);
3167 __Pyx_XDECREF(__pyx_t_4);
3168 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3171 __Pyx_XDECREF(__pyx_v_Context);
3172 __Pyx_XGIVEREF(__pyx_r);
3173 __Pyx_RefNannyFinishContext();
3186 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self);
3187 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3188 PyObject *__pyx_r = 0;
3189 __Pyx_RefNannyDeclarations
3190 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3191 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3194 __Pyx_RefNannyFinishContext();
3198 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3199 PyObject *__pyx_r = NULL;
3200 __Pyx_RefNannyDeclarations
3201 PyObject *__pyx_t_1 = NULL;
3202 __Pyx_RefNannySetupContext(
"__get__", 0);
3203 __Pyx_XDECREF(__pyx_r);
3204 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3205 __Pyx_GOTREF(__pyx_t_1);
3206 __pyx_r = __pyx_t_1;
3212 __Pyx_XDECREF(__pyx_t_1);
3213 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3216 __Pyx_XGIVEREF(__pyx_r);
3217 __Pyx_RefNannyFinishContext();
3222 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3223 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3225 __Pyx_RefNannyDeclarations
3226 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3227 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3230 __Pyx_RefNannyFinishContext();
3234 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3236 __Pyx_RefNannyDeclarations
3238 __Pyx_RefNannySetupContext(
"__set__", 0);
3239 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3240 __pyx_v_self->nd = __pyx_t_1;
3246 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3249 __Pyx_RefNannyFinishContext();
3262 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self);
3263 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3264 PyObject *__pyx_r = 0;
3265 __Pyx_RefNannyDeclarations
3266 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3267 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3270 __Pyx_RefNannyFinishContext();
3274 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3275 PyObject *__pyx_r = NULL;
3276 __Pyx_RefNannyDeclarations
3277 __Pyx_RefNannySetupContext(
"__get__", 0);
3278 __Pyx_XDECREF(__pyx_r);
3279 __Pyx_INCREF(__pyx_v_self->Shape);
3280 __pyx_r = __pyx_v_self->Shape;
3285 __Pyx_XGIVEREF(__pyx_r);
3286 __Pyx_RefNannyFinishContext();
3291 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3292 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3294 __Pyx_RefNannyDeclarations
3295 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3296 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3299 __Pyx_RefNannyFinishContext();
3303 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3305 __Pyx_RefNannyDeclarations
3306 __Pyx_RefNannySetupContext(
"__set__", 0);
3307 __Pyx_INCREF(__pyx_v_value);
3308 __Pyx_GIVEREF(__pyx_v_value);
3309 __Pyx_GOTREF(__pyx_v_self->Shape);
3310 __Pyx_DECREF(__pyx_v_self->Shape);
3311 __pyx_v_self->Shape = __pyx_v_value;
3315 __Pyx_RefNannyFinishContext();
3320 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self);
3321 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3323 __Pyx_RefNannyDeclarations
3324 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3325 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3328 __Pyx_RefNannyFinishContext();
3332 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3334 __Pyx_RefNannyDeclarations
3335 __Pyx_RefNannySetupContext(
"__del__", 0);
3336 __Pyx_INCREF(Py_None);
3337 __Pyx_GIVEREF(Py_None);
3338 __Pyx_GOTREF(__pyx_v_self->Shape);
3339 __Pyx_DECREF(__pyx_v_self->Shape);
3340 __pyx_v_self->Shape = Py_None;
3344 __Pyx_RefNannyFinishContext();
3357 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self);
3358 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3359 PyObject *__pyx_r = 0;
3360 __Pyx_RefNannyDeclarations
3361 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3362 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3365 __Pyx_RefNannyFinishContext();
3369 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3370 PyObject *__pyx_r = NULL;
3371 __Pyx_RefNannyDeclarations
3372 __Pyx_RefNannySetupContext(
"__get__", 0);
3373 __Pyx_XDECREF(__pyx_r);
3374 __Pyx_INCREF(__pyx_v_self->name);
3375 __pyx_r = __pyx_v_self->name;
3380 __Pyx_XGIVEREF(__pyx_r);
3381 __Pyx_RefNannyFinishContext();
3386 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3387 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3389 __Pyx_RefNannyDeclarations
3390 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3391 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3394 __Pyx_RefNannyFinishContext();
3398 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3400 __Pyx_RefNannyDeclarations
3401 PyObject *__pyx_t_1 = NULL;
3402 __Pyx_RefNannySetupContext(
"__set__", 0);
3403 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3404 __pyx_t_1 = __pyx_v_value;
3405 __Pyx_INCREF(__pyx_t_1);
3406 __Pyx_GIVEREF(__pyx_t_1);
3407 __Pyx_GOTREF(__pyx_v_self->name);
3408 __Pyx_DECREF(__pyx_v_self->name);
3409 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3416 __Pyx_XDECREF(__pyx_t_1);
3417 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3420 __Pyx_RefNannyFinishContext();
3425 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self);
3426 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
3428 __Pyx_RefNannyDeclarations
3429 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3430 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3433 __Pyx_RefNannyFinishContext();
3437 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3439 __Pyx_RefNannyDeclarations
3440 __Pyx_RefNannySetupContext(
"__del__", 0);
3441 __Pyx_INCREF(Py_None);
3442 __Pyx_GIVEREF(Py_None);
3443 __Pyx_GOTREF(__pyx_v_self->name);
3444 __Pyx_DECREF(__pyx_v_self->name);
3445 __pyx_v_self->name = ((PyObject*)Py_None);
3449 __Pyx_RefNannyFinishContext();
3462 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self);
3463 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
3464 PyObject *__pyx_r = 0;
3465 __Pyx_RefNannyDeclarations
3466 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3467 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3470 __Pyx_RefNannyFinishContext();
3474 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3475 PyObject *__pyx_r = NULL;
3476 __Pyx_RefNannyDeclarations
3477 __Pyx_RefNannySetupContext(
"__get__", 0);
3478 __Pyx_XDECREF(__pyx_r);
3479 __Pyx_INCREF(__pyx_v_self->BC_type);
3480 __pyx_r = __pyx_v_self->BC_type;
3485 __Pyx_XGIVEREF(__pyx_r);
3486 __Pyx_RefNannyFinishContext();
3491 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3492 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3494 __Pyx_RefNannyDeclarations
3495 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3496 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3499 __Pyx_RefNannyFinishContext();
3503 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3505 __Pyx_RefNannyDeclarations
3506 PyObject *__pyx_t_1 = NULL;
3507 __Pyx_RefNannySetupContext(
"__set__", 0);
3508 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
3509 __pyx_t_1 = __pyx_v_value;
3510 __Pyx_INCREF(__pyx_t_1);
3511 __Pyx_GIVEREF(__pyx_t_1);
3512 __Pyx_GOTREF(__pyx_v_self->BC_type);
3513 __Pyx_DECREF(__pyx_v_self->BC_type);
3514 __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
3521 __Pyx_XDECREF(__pyx_t_1);
3522 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3525 __Pyx_RefNannyFinishContext();
3530 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self);
3531 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
3533 __Pyx_RefNannyDeclarations
3534 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3535 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3538 __Pyx_RefNannyFinishContext();
3542 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3544 __Pyx_RefNannyDeclarations
3545 __Pyx_RefNannySetupContext(
"__del__", 0);
3546 __Pyx_INCREF(Py_None);
3547 __Pyx_GIVEREF(Py_None);
3548 __Pyx_GOTREF(__pyx_v_self->BC_type);
3549 __Pyx_DECREF(__pyx_v_self->BC_type);
3550 __pyx_v_self->BC_type = ((PyObject*)Py_None);
3554 __Pyx_RefNannyFinishContext();
3567 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self);
3568 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
3569 PyObject *__pyx_r = 0;
3570 __Pyx_RefNannyDeclarations
3571 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3572 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3575 __Pyx_RefNannyFinishContext();
3579 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3580 PyObject *__pyx_r = NULL;
3581 __Pyx_RefNannyDeclarations
3582 __Pyx_RefNannySetupContext(
"__get__", 0);
3583 __Pyx_XDECREF(__pyx_r);
3584 __Pyx_INCREF(__pyx_v_self->ct);
3585 __pyx_r = __pyx_v_self->ct;
3590 __Pyx_XGIVEREF(__pyx_r);
3591 __Pyx_RefNannyFinishContext();
3596 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3597 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3599 __Pyx_RefNannyDeclarations
3600 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3601 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3604 __Pyx_RefNannyFinishContext();
3608 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3610 __Pyx_RefNannyDeclarations
3611 __Pyx_RefNannySetupContext(
"__set__", 0);
3612 __Pyx_INCREF(__pyx_v_value);
3613 __Pyx_GIVEREF(__pyx_v_value);
3614 __Pyx_GOTREF(__pyx_v_self->ct);
3615 __Pyx_DECREF(__pyx_v_self->ct);
3616 __pyx_v_self->ct = __pyx_v_value;
3620 __Pyx_RefNannyFinishContext();
3625 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self);
3626 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
3628 __Pyx_RefNannyDeclarations
3629 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3630 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3633 __Pyx_RefNannyFinishContext();
3637 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3639 __Pyx_RefNannyDeclarations
3640 __Pyx_RefNannySetupContext(
"__del__", 0);
3641 __Pyx_INCREF(Py_None);
3642 __Pyx_GIVEREF(Py_None);
3643 __Pyx_GOTREF(__pyx_v_self->ct);
3644 __Pyx_DECREF(__pyx_v_self->ct);
3645 __pyx_v_self->ct = Py_None;
3649 __Pyx_RefNannyFinishContext();
3660 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3661 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, 0};
3662 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3663 PyObject *__pyx_r = 0;
3664 __Pyx_RefNannyDeclarations
3665 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3666 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3669 __Pyx_RefNannyFinishContext();
3673 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3674 int __pyx_v_use_setstate;
3675 PyObject *__pyx_v_state = NULL;
3676 PyObject *__pyx_v__dict = NULL;
3677 PyObject *__pyx_r = NULL;
3678 __Pyx_RefNannyDeclarations
3679 PyObject *__pyx_t_1 = NULL;
3680 PyObject *__pyx_t_2 = NULL;
3681 PyObject *__pyx_t_3 = NULL;
3685 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3694 if (unlikely(!__pyx_v_self->_b_or.memview)) {PyErr_SetString(PyExc_AttributeError,
"Memoryview is not initialized");__PYX_ERR(0, 3, __pyx_L1_error)}
3695 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
3696 __Pyx_GOTREF(__pyx_t_1);
3697 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
3698 __Pyx_GOTREF(__pyx_t_2);
3699 __pyx_t_3 = PyTuple_New(6);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error)
3700 __Pyx_GOTREF(__pyx_t_3);
3701 __Pyx_INCREF(__pyx_v_self->BC_type);
3702 __Pyx_GIVEREF(__pyx_v_self->BC_type);
3703 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
3704 __Pyx_INCREF(__pyx_v_self->Shape);
3705 __Pyx_GIVEREF(__pyx_v_self->Shape);
3706 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
3707 __Pyx_GIVEREF(__pyx_t_1);
3708 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
3709 __Pyx_INCREF(__pyx_v_self->ct);
3710 __Pyx_GIVEREF(__pyx_v_self->ct);
3711 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
3712 __Pyx_INCREF(__pyx_v_self->name);
3713 __Pyx_GIVEREF(__pyx_v_self->name);
3714 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
3715 __Pyx_GIVEREF(__pyx_t_2);
3716 PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
3719 __pyx_v_state = ((PyObject*)__pyx_t_3);
3729 __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
3730 __Pyx_GOTREF(__pyx_t_3);
3731 __pyx_v__dict = __pyx_t_3;
3741 __pyx_t_4 = (__pyx_v__dict != Py_None);
3742 __pyx_t_5 = (__pyx_t_4 != 0);
3752 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error)
3753 __Pyx_GOTREF(__pyx_t_3);
3754 __Pyx_INCREF(__pyx_v__dict);
3755 __Pyx_GIVEREF(__pyx_v__dict);
3756 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
3757 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
3758 __Pyx_GOTREF(__pyx_t_2);
3759 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3760 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
3770 __pyx_v_use_setstate = 1;
3790 __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
3791 __pyx_t_6 = (__pyx_t_4 != 0);
3794 __pyx_t_5 = __pyx_t_6;
3795 goto __pyx_L4_bool_binop_done;
3797 __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
3798 __pyx_t_4 = (__pyx_t_6 != 0);
3801 __pyx_t_5 = __pyx_t_4;
3802 goto __pyx_L4_bool_binop_done;
3804 __pyx_t_4 = (__pyx_v_self->ct != Py_None);
3805 __pyx_t_6 = (__pyx_t_4 != 0);
3808 __pyx_t_5 = __pyx_t_6;
3809 goto __pyx_L4_bool_binop_done;
3811 __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
3812 __pyx_t_4 = (__pyx_t_6 != 0);
3813 __pyx_t_5 = __pyx_t_4;
3814 __pyx_L4_bool_binop_done:;
3815 __pyx_v_use_setstate = __pyx_t_5;
3826 __pyx_t_5 = (__pyx_v_use_setstate != 0);
3836 __Pyx_XDECREF(__pyx_r);
3837 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
3838 __Pyx_GOTREF(__pyx_t_2);
3839 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error)
3840 __Pyx_GOTREF(__pyx_t_3);
3841 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3842 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3843 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3844 __Pyx_INCREF(__pyx_int_158231071);
3845 __Pyx_GIVEREF(__pyx_int_158231071);
3846 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
3847 __Pyx_INCREF(Py_None);
3848 __Pyx_GIVEREF(Py_None);
3849 PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
3850 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
3851 __Pyx_GOTREF(__pyx_t_1);
3852 __Pyx_GIVEREF(__pyx_t_2);
3853 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3854 __Pyx_GIVEREF(__pyx_t_3);
3855 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
3856 __Pyx_INCREF(__pyx_v_state);
3857 __Pyx_GIVEREF(__pyx_v_state);
3858 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
3861 __pyx_r = __pyx_t_1;
3882 __Pyx_XDECREF(__pyx_r);
3883 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
3884 __Pyx_GOTREF(__pyx_t_1);
3885 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error)
3886 __Pyx_GOTREF(__pyx_t_3);
3887 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3888 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3889 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3890 __Pyx_INCREF(__pyx_int_158231071);
3891 __Pyx_GIVEREF(__pyx_int_158231071);
3892 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
3893 __Pyx_INCREF(__pyx_v_state);
3894 __Pyx_GIVEREF(__pyx_v_state);
3895 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
3896 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
3897 __Pyx_GOTREF(__pyx_t_2);
3898 __Pyx_GIVEREF(__pyx_t_1);
3899 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
3900 __Pyx_GIVEREF(__pyx_t_3);
3901 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
3904 __pyx_r = __pyx_t_2;
3917 __Pyx_XDECREF(__pyx_t_1);
3918 __Pyx_XDECREF(__pyx_t_2);
3919 __Pyx_XDECREF(__pyx_t_3);
3920 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3923 __Pyx_XDECREF(__pyx_v_state);
3924 __Pyx_XDECREF(__pyx_v__dict);
3925 __Pyx_XGIVEREF(__pyx_r);
3926 __Pyx_RefNannyFinishContext();
3938 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3939 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, 0};
3940 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3941 PyObject *__pyx_r = 0;
3942 __Pyx_RefNannyDeclarations
3943 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3944 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3947 __Pyx_RefNannyFinishContext();
3951 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3952 PyObject *__pyx_r = NULL;
3953 __Pyx_RefNannyDeclarations
3954 PyObject *__pyx_t_1 = NULL;
3955 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
3962 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 15, __pyx_L1_error)
3963 __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
3964 __Pyx_GOTREF(__pyx_t_1);
3965 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3975 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3978 __Pyx_XDECREF(__pyx_t_1);
3979 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3982 __Pyx_XGIVEREF(__pyx_r);
3983 __Pyx_RefNannyFinishContext();
3996 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3997 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3999 __Pyx_RefNannyDeclarations
4000 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
4001 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4002 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args));
return -1;}
4003 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds,
"__init__", 0)))
return -1;
4004 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4007 __Pyx_RefNannyFinishContext();
4011 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4013 __Pyx_RefNannyDeclarations
4014 __Pyx_RefNannySetupContext(
"__init__", 0);
4023 __Pyx_INCREF(Py_None);
4024 __Pyx_GIVEREF(Py_None);
4025 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4026 __Pyx_DECREF(__pyx_v_self->uOfXT);
4027 __pyx_v_self->uOfXT = Py_None;
4039 __Pyx_RefNannyFinishContext();
4052 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4053 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, 0};
4054 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4055 PyObject *__pyx_r = 0;
4056 __Pyx_RefNannyDeclarations
4057 __Pyx_RefNannySetupContext(
"init_cython (wrapper)", 0);
4058 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4061 __Pyx_RefNannyFinishContext();
4065 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4066 PyObject *__pyx_r = NULL;
4067 __Pyx_RefNannyDeclarations
4068 __Pyx_RefNannySetupContext(
"init_cython", 0);
4077 __Pyx_XDECREF(__pyx_r);
4078 __Pyx_INCREF(__pyx_v_self->uOfXT);
4079 __pyx_r = __pyx_v_self->uOfXT;
4092 __Pyx_XGIVEREF(__pyx_r);
4093 __Pyx_RefNannyFinishContext();
4105 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4106 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch) {
4107 __Pyx_RefNannyDeclarations
4108 PyObject *__pyx_t_1 = NULL;
4109 PyObject *__pyx_t_2 = NULL;
4110 PyObject *__pyx_t_3 = NULL;
4111 PyObject *__pyx_t_4 = NULL;
4112 __Pyx_RefNannySetupContext(
"resetBC", 0);
4114 if (unlikely(__pyx_skip_dispatch)) ;
4116 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
4117 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
4118 __Pyx_GOTREF(__pyx_t_1);
4119 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4120 __Pyx_INCREF(__pyx_t_1);
4121 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4122 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4123 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4124 if (likely(__pyx_t_4)) {
4125 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4126 __Pyx_INCREF(__pyx_t_4);
4127 __Pyx_INCREF(
function);
4128 __Pyx_DECREF_SET(__pyx_t_3,
function);
4132 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error)
4133 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4135 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error)
4137 __Pyx_GOTREF(__pyx_t_2);
4138 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4139 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4140 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4143 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4153 __Pyx_INCREF(Py_None);
4154 __Pyx_GIVEREF(Py_None);
4155 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4156 __Pyx_DECREF(__pyx_v_self->uOfXT);
4157 __pyx_v_self->uOfXT = Py_None;
4170 __Pyx_XDECREF(__pyx_t_1);
4171 __Pyx_XDECREF(__pyx_t_2);
4172 __Pyx_XDECREF(__pyx_t_3);
4173 __Pyx_XDECREF(__pyx_t_4);
4174 __Pyx_WriteUnraisable(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4176 __Pyx_RefNannyFinishContext();
4180 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4181 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {
"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, 0};
4182 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4183 PyObject *__pyx_r = 0;
4184 __Pyx_RefNannyDeclarations
4185 __Pyx_RefNannySetupContext(
"resetBC (wrapper)", 0);
4186 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4189 __Pyx_RefNannyFinishContext();
4193 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4194 PyObject *__pyx_r = NULL;
4195 __Pyx_RefNannyDeclarations
4196 PyObject *__pyx_t_1 = NULL;
4197 __Pyx_RefNannySetupContext(
"resetBC", 0);
4198 __Pyx_XDECREF(__pyx_r);
4199 __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
4200 __Pyx_GOTREF(__pyx_t_1);
4201 __pyx_r = __pyx_t_1;
4207 __Pyx_XDECREF(__pyx_t_1);
4208 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4211 __Pyx_XGIVEREF(__pyx_r);
4212 __Pyx_RefNannyFinishContext();
4225 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4226 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] =
"\n function returning constant BC\n\n Parameters\n ----------\n value :\n\n ";
4227 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4228 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4229 PyObject *__pyx_r = 0;
4230 __Pyx_RefNannyDeclarations
4231 __Pyx_RefNannySetupContext(
"setConstantBC (wrapper)", 0);
4232 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4235 __Pyx_RefNannyFinishContext();
4248 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4249 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {
"lambda", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
4250 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4251 CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4252 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4253 PyObject *__pyx_r = 0;
4254 __Pyx_RefNannyDeclarations
4255 __Pyx_RefNannySetupContext(
"lambda (wrapper)", 0);
4257 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
4258 PyObject* values[2] = {0,0};
4259 if (unlikely(__pyx_kwds)) {
4261 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4263 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4265 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4268 default:
goto __pyx_L5_argtuple_error;
4270 kw_args = PyDict_Size(__pyx_kwds);
4273 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4274 else goto __pyx_L5_argtuple_error;
4277 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4279 __Pyx_RaiseArgtupleInvalid(
"lambda", 1, 2, 2, 1); __PYX_ERR(1, 85, __pyx_L3_error)
4282 if (unlikely(kw_args > 0)) {
4283 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda") < 0)) __PYX_ERR(1, 85, __pyx_L3_error)
4285 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4286 goto __pyx_L5_argtuple_error;
4288 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4289 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4291 __pyx_v_x = values[0];
4292 __pyx_v_t = values[1];
4294 goto __pyx_L4_argument_unpacking_done;
4295 __pyx_L5_argtuple_error:;
4296 __Pyx_RaiseArgtupleInvalid(
"lambda", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 85, __pyx_L3_error)
4298 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4299 __Pyx_RefNannyFinishContext();
4301 __pyx_L4_argument_unpacking_done:;
4302 __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t);
4305 __Pyx_RefNannyFinishContext();
4309 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t) {
4310 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4311 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
4312 PyObject *__pyx_r = NULL;
4313 __Pyx_RefNannyDeclarations
4314 __Pyx_RefNannySetupContext(
"lambda", 0);
4315 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4316 __pyx_cur_scope = __pyx_outer_scope;
4317 __Pyx_XDECREF(__pyx_r);
4318 if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError(
"value"); __PYX_ERR(1, 85, __pyx_L1_error) }
4319 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4320 __pyx_r = __pyx_cur_scope->__pyx_v_value;
4325 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4328 __Pyx_XGIVEREF(__pyx_r);
4329 __Pyx_RefNannyFinishContext();
4341 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
4342 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4343 PyObject *__pyx_r = NULL;
4344 __Pyx_RefNannyDeclarations
4345 PyObject *__pyx_t_1 = NULL;
4346 __Pyx_RefNannySetupContext(
"setConstantBC", 0);
4347 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
4348 if (unlikely(!__pyx_cur_scope)) {
4349 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
4350 __Pyx_INCREF(Py_None);
4351 __PYX_ERR(1, 76, __pyx_L1_error)
4353 __Pyx_GOTREF(__pyx_cur_scope);
4355 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
4356 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4357 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
4366 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error)
4367 __Pyx_GOTREF(__pyx_t_1);
4368 __Pyx_GIVEREF(__pyx_t_1);
4369 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4370 __Pyx_DECREF(__pyx_v_self->uOfXT);
4371 __pyx_v_self->uOfXT = __pyx_t_1;
4383 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4386 __Pyx_XDECREF(__pyx_t_1);
4387 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4390 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4391 __Pyx_XGIVEREF(__pyx_r);
4392 __Pyx_RefNannyFinishContext();
4404 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4405 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {
"setLinearBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, 0};
4406 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4407 PyObject *__pyx_v_a0 = 0;
4408 PyObject *__pyx_v_a1 = 0;
4409 PyObject *__pyx_v_i = 0;
4410 PyObject *__pyx_r = 0;
4411 __Pyx_RefNannyDeclarations
4412 __Pyx_RefNannySetupContext(
"setLinearBC (wrapper)", 0);
4414 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a1,&__pyx_n_s_i,0};
4415 PyObject* values[3] = {0,0,0};
4416 if (unlikely(__pyx_kwds)) {
4418 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4420 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4422 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4424 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4427 default:
goto __pyx_L5_argtuple_error;
4429 kw_args = PyDict_Size(__pyx_kwds);
4432 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
4433 else goto __pyx_L5_argtuple_error;
4436 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a1)) != 0)) kw_args--;
4438 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 3, 3, 1); __PYX_ERR(1, 88, __pyx_L3_error)
4442 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
4444 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 3, 3, 2); __PYX_ERR(1, 88, __pyx_L3_error)
4447 if (unlikely(kw_args > 0)) {
4448 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setLinearBC") < 0)) __PYX_ERR(1, 88, __pyx_L3_error)
4450 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4451 goto __pyx_L5_argtuple_error;
4453 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4454 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4455 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4457 __pyx_v_a0 = values[0];
4458 __pyx_v_a1 = values[1];
4459 __pyx_v_i = values[2];
4461 goto __pyx_L4_argument_unpacking_done;
4462 __pyx_L5_argtuple_error:;
4463 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 88, __pyx_L3_error)
4465 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4466 __Pyx_RefNannyFinishContext();
4468 __pyx_L4_argument_unpacking_done:;
4469 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a1, __pyx_v_i);
4472 __Pyx_RefNannyFinishContext();
4483 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4484 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {
"lambda1", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
4485 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4486 PyObject *__pyx_v_x = 0;
4487 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4488 PyObject *__pyx_r = 0;
4489 __Pyx_RefNannyDeclarations
4490 __Pyx_RefNannySetupContext(
"lambda1 (wrapper)", 0);
4492 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
4493 PyObject* values[2] = {0,0};
4494 if (unlikely(__pyx_kwds)) {
4496 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4498 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4500 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4503 default:
goto __pyx_L5_argtuple_error;
4505 kw_args = PyDict_Size(__pyx_kwds);
4508 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4509 else goto __pyx_L5_argtuple_error;
4512 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4514 __Pyx_RaiseArgtupleInvalid(
"lambda1", 1, 2, 2, 1); __PYX_ERR(1, 89, __pyx_L3_error)
4517 if (unlikely(kw_args > 0)) {
4518 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda1") < 0)) __PYX_ERR(1, 89, __pyx_L3_error)
4520 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4521 goto __pyx_L5_argtuple_error;
4523 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4524 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4526 __pyx_v_x = values[0];
4527 __pyx_v_t = values[1];
4529 goto __pyx_L4_argument_unpacking_done;
4530 __pyx_L5_argtuple_error:;
4531 __Pyx_RaiseArgtupleInvalid(
"lambda1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 89, __pyx_L3_error)
4533 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4534 __Pyx_RefNannyFinishContext();
4536 __pyx_L4_argument_unpacking_done:;
4537 __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t);
4540 __Pyx_RefNannyFinishContext();
4544 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t) {
4545 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
4546 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
4547 PyObject *__pyx_r = NULL;
4548 __Pyx_RefNannyDeclarations
4549 PyObject *__pyx_t_1 = NULL;
4550 PyObject *__pyx_t_2 = NULL;
4551 __Pyx_RefNannySetupContext(
"lambda1", 0);
4552 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4553 __pyx_cur_scope = __pyx_outer_scope;
4554 __Pyx_XDECREF(__pyx_r);
4555 if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError(
"a0"); __PYX_ERR(1, 89, __pyx_L1_error) }
4556 if (unlikely(!__pyx_cur_scope->__pyx_v_a1)) { __Pyx_RaiseClosureNameError(
"a1"); __PYX_ERR(1, 89, __pyx_L1_error) }
4557 if (unlikely(!__pyx_cur_scope->__pyx_v_i)) { __Pyx_RaiseClosureNameError(
"i"); __PYX_ERR(1, 89, __pyx_L1_error) }
4558 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_x, __pyx_cur_scope->__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
4559 __Pyx_GOTREF(__pyx_t_1);
4560 __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_a1, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 89, __pyx_L1_error)
4561 __Pyx_GOTREF(__pyx_t_2);
4562 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4563 __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
4564 __Pyx_GOTREF(__pyx_t_1);
4565 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4566 __pyx_r = __pyx_t_1;
4572 __Pyx_XDECREF(__pyx_t_1);
4573 __Pyx_XDECREF(__pyx_t_2);
4574 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4577 __Pyx_XGIVEREF(__pyx_r);
4578 __Pyx_RefNannyFinishContext();
4589 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a1, PyObject *__pyx_v_i) {
4590 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
4591 PyObject *__pyx_r = NULL;
4592 __Pyx_RefNannyDeclarations
4593 PyObject *__pyx_t_1 = NULL;
4594 __Pyx_RefNannySetupContext(
"setLinearBC", 0);
4595 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
4596 if (unlikely(!__pyx_cur_scope)) {
4597 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
4598 __Pyx_INCREF(Py_None);
4599 __PYX_ERR(1, 88, __pyx_L1_error)
4601 __Pyx_GOTREF(__pyx_cur_scope);
4603 __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
4604 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
4605 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
4606 __pyx_cur_scope->__pyx_v_a1 = __pyx_v_a1;
4607 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a1);
4608 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a1);
4609 __pyx_cur_scope->__pyx_v_i = __pyx_v_i;
4610 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_i);
4611 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_i);
4618 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
4619 __Pyx_GOTREF(__pyx_t_1);
4620 __Pyx_GIVEREF(__pyx_t_1);
4621 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4622 __Pyx_DECREF(__pyx_v_self->uOfXT);
4623 __pyx_v_self->uOfXT = __pyx_t_1;
4634 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4637 __Pyx_XDECREF(__pyx_t_1);
4638 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4641 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4642 __Pyx_XGIVEREF(__pyx_r);
4643 __Pyx_RefNannyFinishContext();
4656 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self);
4657 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
4658 PyObject *__pyx_r = 0;
4659 __Pyx_RefNannyDeclarations
4660 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4661 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4664 __Pyx_RefNannyFinishContext();
4668 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4669 PyObject *__pyx_r = NULL;
4670 __Pyx_RefNannyDeclarations
4671 __Pyx_RefNannySetupContext(
"__get__", 0);
4672 __Pyx_XDECREF(__pyx_r);
4673 __Pyx_INCREF(__pyx_v_self->uOfXT);
4674 __pyx_r = __pyx_v_self->uOfXT;
4679 __Pyx_XGIVEREF(__pyx_r);
4680 __Pyx_RefNannyFinishContext();
4685 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4686 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4688 __Pyx_RefNannyDeclarations
4689 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
4690 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4693 __Pyx_RefNannyFinishContext();
4697 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
4699 __Pyx_RefNannyDeclarations
4700 __Pyx_RefNannySetupContext(
"__set__", 0);
4701 __Pyx_INCREF(__pyx_v_value);
4702 __Pyx_GIVEREF(__pyx_v_value);
4703 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4704 __Pyx_DECREF(__pyx_v_self->uOfXT);
4705 __pyx_v_self->uOfXT = __pyx_v_value;
4709 __Pyx_RefNannyFinishContext();
4714 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self);
4715 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
4717 __Pyx_RefNannyDeclarations
4718 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
4719 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4722 __Pyx_RefNannyFinishContext();
4726 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4728 __Pyx_RefNannyDeclarations
4729 __Pyx_RefNannySetupContext(
"__del__", 0);
4730 __Pyx_INCREF(Py_None);
4731 __Pyx_GIVEREF(Py_None);
4732 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4733 __Pyx_DECREF(__pyx_v_self->uOfXT);
4734 __pyx_v_self->uOfXT = Py_None;
4738 __Pyx_RefNannyFinishContext();
4749 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4750 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__, METH_NOARGS, 0};
4751 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4752 PyObject *__pyx_r = 0;
4753 __Pyx_RefNannyDeclarations
4754 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
4755 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4758 __Pyx_RefNannyFinishContext();
4762 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4763 PyObject *__pyx_r = NULL;
4764 __Pyx_RefNannyDeclarations
4765 PyObject *__pyx_t_1 = NULL;
4766 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
4774 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
4775 __Pyx_GOTREF(__pyx_t_1);
4776 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4778 __PYX_ERR(0, 2, __pyx_L1_error)
4788 __Pyx_XDECREF(__pyx_t_1);
4789 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4791 __Pyx_XGIVEREF(__pyx_r);
4792 __Pyx_RefNannyFinishContext();
4804 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
4805 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__, METH_O, 0};
4806 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4807 PyObject *__pyx_r = 0;
4808 __Pyx_RefNannyDeclarations
4809 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
4810 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4813 __Pyx_RefNannyFinishContext();
4817 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4818 PyObject *__pyx_r = NULL;
4819 __Pyx_RefNannyDeclarations
4820 PyObject *__pyx_t_1 = NULL;
4821 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
4828 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
4829 __Pyx_GOTREF(__pyx_t_1);
4830 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4831 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4832 __PYX_ERR(0, 4, __pyx_L1_error)
4843 __Pyx_XDECREF(__pyx_t_1);
4844 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4846 __Pyx_XGIVEREF(__pyx_r);
4847 __Pyx_RefNannyFinishContext();
4858 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4859 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {
"__pyx_unpickle_BC_Base", (PyCFunction)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, 0};
4860 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4861 PyObject *__pyx_v___pyx_type = 0;
4862 long __pyx_v___pyx_checksum;
4863 PyObject *__pyx_v___pyx_state = 0;
4864 PyObject *__pyx_r = 0;
4865 __Pyx_RefNannyDeclarations
4866 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base (wrapper)", 0);
4868 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
4869 PyObject* values[3] = {0,0,0};
4870 if (unlikely(__pyx_kwds)) {
4872 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4874 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4876 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4878 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4881 default:
goto __pyx_L5_argtuple_error;
4883 kw_args = PyDict_Size(__pyx_kwds);
4886 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
4887 else goto __pyx_L5_argtuple_error;
4890 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
4892 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error)
4896 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
4898 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error)
4901 if (unlikely(kw_args > 0)) {
4902 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(0, 1, __pyx_L3_error)
4904 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4905 goto __pyx_L5_argtuple_error;
4907 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4908 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4909 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4911 __pyx_v___pyx_type = values[0];
4912 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error)
4913 __pyx_v___pyx_state = values[2];
4915 goto __pyx_L4_argument_unpacking_done;
4916 __pyx_L5_argtuple_error:;
4917 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error)
4919 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
4920 __Pyx_RefNannyFinishContext();
4922 __pyx_L4_argument_unpacking_done:;
4923 __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
4926 __Pyx_RefNannyFinishContext();
4930 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
4931 PyObject *__pyx_v___pyx_PickleError = NULL;
4932 PyObject *__pyx_v___pyx_result = NULL;
4933 PyObject *__pyx_r = NULL;
4934 __Pyx_RefNannyDeclarations
4936 PyObject *__pyx_t_2 = NULL;
4937 PyObject *__pyx_t_3 = NULL;
4938 PyObject *__pyx_t_4 = NULL;
4939 PyObject *__pyx_t_5 = NULL;
4940 PyObject *__pyx_t_6 = NULL;
4942 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base", 0);
4950 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x96e6a1f) != 0);
4960 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
4961 __Pyx_GOTREF(__pyx_t_2);
4962 __Pyx_INCREF(__pyx_n_s_PickleError);
4963 __Pyx_GIVEREF(__pyx_n_s_PickleError);
4964 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
4965 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error)
4966 __Pyx_GOTREF(__pyx_t_3);
4967 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4968 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
4969 __Pyx_GOTREF(__pyx_t_2);
4970 __Pyx_INCREF(__pyx_t_2);
4971 __pyx_v___pyx_PickleError = __pyx_t_2;
4972 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4973 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4982 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
4983 __Pyx_GOTREF(__pyx_t_2);
4984 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4, __pyx_L1_error)
4985 __Pyx_GOTREF(__pyx_t_4);
4986 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4987 __Pyx_INCREF(__pyx_v___pyx_PickleError);
4988 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
4989 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4990 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
4991 if (likely(__pyx_t_5)) {
4992 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4993 __Pyx_INCREF(__pyx_t_5);
4994 __Pyx_INCREF(
function);
4995 __Pyx_DECREF_SET(__pyx_t_2,
function);
4999 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
5000 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5001 __Pyx_GOTREF(__pyx_t_3);
5003 #if CYTHON_FAST_PYCALL 5004 if (PyFunction_Check(__pyx_t_2)) {
5005 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
5006 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
5007 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5008 __Pyx_GOTREF(__pyx_t_3);
5009 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5012 #if CYTHON_FAST_PYCCALL 5013 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5014 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
5015 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
5016 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5017 __Pyx_GOTREF(__pyx_t_3);
5018 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5022 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4, __pyx_L1_error)
5023 __Pyx_GOTREF(__pyx_t_6);
5024 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
5025 __Pyx_GIVEREF(__pyx_t_4);
5026 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
5028 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
5029 __Pyx_GOTREF(__pyx_t_3);
5030 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5033 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5034 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5035 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5036 __PYX_ERR(0, 4, __pyx_L1_error)
5053 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
5054 __Pyx_GOTREF(__pyx_t_2);
5056 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5057 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
5058 if (likely(__pyx_t_6)) {
5059 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5060 __Pyx_INCREF(__pyx_t_6);
5061 __Pyx_INCREF(
function);
5062 __Pyx_DECREF_SET(__pyx_t_2,
function);
5066 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
5067 __Pyx_GOTREF(__pyx_t_3);
5069 #if CYTHON_FAST_PYCALL 5070 if (PyFunction_Check(__pyx_t_2)) {
5071 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
5072 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
5073 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5074 __Pyx_GOTREF(__pyx_t_3);
5077 #if CYTHON_FAST_PYCCALL 5078 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5079 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
5080 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
5081 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5082 __Pyx_GOTREF(__pyx_t_3);
5086 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error)
5087 __Pyx_GOTREF(__pyx_t_4);
5088 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
5089 __Pyx_INCREF(__pyx_v___pyx_type);
5090 __Pyx_GIVEREF(__pyx_v___pyx_type);
5091 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
5092 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
5093 __Pyx_GOTREF(__pyx_t_3);
5094 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5097 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5098 __pyx_v___pyx_result = __pyx_t_3;
5108 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
5109 __pyx_t_7 = (__pyx_t_1 != 0);
5119 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 7, __pyx_L1_error)
5120 __pyx_t_3 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
5121 __Pyx_GOTREF(__pyx_t_3);
5122 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5140 __Pyx_XDECREF(__pyx_r);
5141 __Pyx_INCREF(__pyx_v___pyx_result);
5142 __pyx_r = __pyx_v___pyx_result;
5153 __Pyx_XDECREF(__pyx_t_2);
5154 __Pyx_XDECREF(__pyx_t_3);
5155 __Pyx_XDECREF(__pyx_t_4);
5156 __Pyx_XDECREF(__pyx_t_5);
5157 __Pyx_XDECREF(__pyx_t_6);
5158 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5161 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
5162 __Pyx_XDECREF(__pyx_v___pyx_result);
5163 __Pyx_XGIVEREF(__pyx_r);
5164 __Pyx_RefNannyFinishContext();
5176 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
5177 PyObject *__pyx_r = NULL;
5178 __Pyx_RefNannyDeclarations
5179 PyObject *__pyx_t_1 = NULL;
5180 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5183 Py_ssize_t __pyx_t_5;
5186 PyObject *__pyx_t_8 = NULL;
5187 PyObject *__pyx_t_9 = NULL;
5188 PyObject *__pyx_t_10 = NULL;
5189 PyObject *__pyx_t_11 = NULL;
5190 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base__set_state", 0);
5199 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5200 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5201 __PYX_ERR(0, 10, __pyx_L1_error)
5203 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5204 __Pyx_GOTREF(__pyx_t_1);
5205 if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 10, __pyx_L1_error)
5206 __Pyx_GIVEREF(__pyx_t_1);
5207 __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
5208 __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
5209 __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
5211 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5212 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5213 __PYX_ERR(0, 10, __pyx_L1_error)
5215 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5216 __Pyx_GOTREF(__pyx_t_1);
5217 __Pyx_GIVEREF(__pyx_t_1);
5218 __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
5219 __Pyx_DECREF(__pyx_v___pyx_result->Shape);
5220 __pyx_v___pyx_result->Shape = __pyx_t_1;
5222 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5223 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5224 __PYX_ERR(0, 10, __pyx_L1_error)
5226 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5227 __Pyx_GOTREF(__pyx_t_1);
5228 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 10, __pyx_L1_error)
5229 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5230 __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
5231 __pyx_v___pyx_result->_b_or = __pyx_t_2;
5232 __pyx_t_2.memview = NULL;
5233 __pyx_t_2.data = NULL;
5234 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5235 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5236 __PYX_ERR(0, 10, __pyx_L1_error)
5238 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5239 __Pyx_GOTREF(__pyx_t_1);
5240 __Pyx_GIVEREF(__pyx_t_1);
5241 __Pyx_GOTREF(__pyx_v___pyx_result->ct);
5242 __Pyx_DECREF(__pyx_v___pyx_result->ct);
5243 __pyx_v___pyx_result->ct = __pyx_t_1;
5245 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5246 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5247 __PYX_ERR(0, 10, __pyx_L1_error)
5249 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5250 __Pyx_GOTREF(__pyx_t_1);
5251 if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 10, __pyx_L1_error)
5252 __Pyx_GIVEREF(__pyx_t_1);
5253 __Pyx_GOTREF(__pyx_v___pyx_result->name);
5254 __Pyx_DECREF(__pyx_v___pyx_result->name);
5255 __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
5257 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5258 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5259 __PYX_ERR(0, 10, __pyx_L1_error)
5261 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5262 __Pyx_GOTREF(__pyx_t_1);
5263 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L1_error)
5264 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5265 __pyx_v___pyx_result->nd = __pyx_t_3;
5273 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5274 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
5275 __PYX_ERR(0, 11, __pyx_L1_error)
5277 __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 11, __pyx_L1_error)
5278 __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
5281 __pyx_t_4 = __pyx_t_6;
5282 goto __pyx_L4_bool_binop_done;
5284 __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(0, 11, __pyx_L1_error)
5285 __pyx_t_7 = (__pyx_t_6 != 0);
5286 __pyx_t_4 = __pyx_t_7;
5287 __pyx_L4_bool_binop_done:;
5295 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 12, __pyx_L1_error)
5296 __Pyx_GOTREF(__pyx_t_8);
5297 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 12, __pyx_L1_error)
5298 __Pyx_GOTREF(__pyx_t_9);
5299 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5300 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5301 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5302 __PYX_ERR(0, 12, __pyx_L1_error)
5304 __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 12, __pyx_L1_error)
5305 __Pyx_GOTREF(__pyx_t_8);
5307 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
5308 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
5309 if (likely(__pyx_t_10)) {
5310 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
5311 __Pyx_INCREF(__pyx_t_10);
5312 __Pyx_INCREF(
function);
5313 __Pyx_DECREF_SET(__pyx_t_9,
function);
5317 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
5318 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5319 __Pyx_GOTREF(__pyx_t_1);
5321 #if CYTHON_FAST_PYCALL 5322 if (PyFunction_Check(__pyx_t_9)) {
5323 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
5324 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
5325 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5326 __Pyx_GOTREF(__pyx_t_1);
5327 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5330 #if CYTHON_FAST_PYCCALL 5331 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
5332 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
5333 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
5334 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5335 __Pyx_GOTREF(__pyx_t_1);
5336 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5340 __pyx_t_11 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 12, __pyx_L1_error)
5341 __Pyx_GOTREF(__pyx_t_11);
5342 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
5343 __Pyx_GIVEREF(__pyx_t_8);
5344 PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_8);
5346 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
5347 __Pyx_GOTREF(__pyx_t_1);
5348 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5351 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5352 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5371 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5374 __Pyx_XDECREF(__pyx_t_1);
5375 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5376 __Pyx_XDECREF(__pyx_t_8);
5377 __Pyx_XDECREF(__pyx_t_9);
5378 __Pyx_XDECREF(__pyx_t_10);
5379 __Pyx_XDECREF(__pyx_t_11);
5380 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
5383 __Pyx_XGIVEREF(__pyx_r);
5384 __Pyx_RefNannyFinishContext();
5397 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
5398 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5400 __Pyx_RefNannyDeclarations
5401 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
5402 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
5405 __Pyx_RefNannyFinishContext();
5409 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5412 int __pyx_v_endian_detector;
5413 int __pyx_v_little_endian;
5416 PyArray_Descr *__pyx_v_descr = 0;
5419 __Pyx_RefNannyDeclarations
5422 PyObject *__pyx_t_3 = NULL;
5426 PyObject *__pyx_t_7 = NULL;
5428 if (__pyx_v_info == NULL) {
5429 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
5432 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
5433 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5434 __Pyx_GIVEREF(__pyx_v_info->obj);
5443 __pyx_v_endian_detector = 1;
5452 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
5461 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
5470 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
5473 __pyx_t_1 = __pyx_t_2;
5474 goto __pyx_L4_bool_binop_done;
5484 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
5485 __pyx_t_1 = __pyx_t_2;
5486 __pyx_L4_bool_binop_done:;
5495 if (unlikely(__pyx_t_1)) {
5504 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 229, __pyx_L1_error)
5505 __Pyx_GOTREF(__pyx_t_3);
5506 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5507 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5508 __PYX_ERR(3, 229, __pyx_L1_error)
5526 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
5529 __pyx_t_1 = __pyx_t_2;
5530 goto __pyx_L7_bool_binop_done;
5540 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
5541 __pyx_t_1 = __pyx_t_2;
5542 __pyx_L7_bool_binop_done:;
5551 if (unlikely(__pyx_t_1)) {
5560 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 233, __pyx_L1_error)
5561 __Pyx_GOTREF(__pyx_t_3);
5562 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5563 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5564 __PYX_ERR(3, 233, __pyx_L1_error)
5582 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
5591 __pyx_v_info->ndim = __pyx_v_ndim;
5600 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
5610 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
5619 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
5628 __pyx_t_4 = __pyx_v_ndim;
5629 __pyx_t_5 = __pyx_t_4;
5630 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
5631 __pyx_v_i = __pyx_t_6;
5640 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
5649 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
5670 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
5679 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
5690 __pyx_v_info->suboffsets = NULL;
5699 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
5708 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
5726 __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
5727 __Pyx_INCREF(__pyx_t_3);
5728 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
5738 __Pyx_INCREF(((PyObject *)__pyx_v_self));
5739 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
5740 __Pyx_GOTREF(__pyx_v_info->obj);
5741 __Pyx_DECREF(__pyx_v_info->obj);
5742 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5751 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
5761 __pyx_t_4 = __pyx_v_descr->type_num;
5762 __pyx_v_t = __pyx_t_4;
5771 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
5773 goto __pyx_L15_next_or;
5776 __pyx_t_2 = (__pyx_v_little_endian != 0);
5779 __pyx_t_1 = __pyx_t_2;
5780 goto __pyx_L14_bool_binop_done;
5791 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
5794 __pyx_t_1 = __pyx_t_2;
5795 goto __pyx_L14_bool_binop_done;
5797 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
5798 __pyx_t_1 = __pyx_t_2;
5799 __pyx_L14_bool_binop_done:;
5808 if (unlikely(__pyx_t_1)) {
5817 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 263, __pyx_L1_error)
5818 __Pyx_GOTREF(__pyx_t_3);
5819 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5820 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5821 __PYX_ERR(3, 263, __pyx_L1_error)
5839 switch (__pyx_v_t) {
5841 __pyx_v_f = ((
char *)
"b");
5852 __pyx_v_f = ((
char *)
"B");
5863 __pyx_v_f = ((
char *)
"h");
5874 __pyx_v_f = ((
char *)
"H");
5885 __pyx_v_f = ((
char *)
"i");
5896 __pyx_v_f = ((
char *)
"I");
5907 __pyx_v_f = ((
char *)
"l");
5918 __pyx_v_f = ((
char *)
"L");
5929 __pyx_v_f = ((
char *)
"q");
5940 __pyx_v_f = ((
char *)
"Q");
5951 __pyx_v_f = ((
char *)
"f");
5962 __pyx_v_f = ((
char *)
"d");
5972 case NPY_LONGDOUBLE:
5973 __pyx_v_f = ((
char *)
"g");
5984 __pyx_v_f = ((
char *)
"Zf");
5995 __pyx_v_f = ((
char *)
"Zd");
6005 case NPY_CLONGDOUBLE:
6006 __pyx_v_f = ((
char *)
"Zg");
6017 __pyx_v_f = ((
char *)
"O");
6028 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error)
6029 __Pyx_GOTREF(__pyx_t_3);
6030 __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3);
if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 282, __pyx_L1_error)
6031 __Pyx_GOTREF(__pyx_t_7);
6032 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6033 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error)
6034 __Pyx_GOTREF(__pyx_t_3);
6035 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6036 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6037 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6038 __PYX_ERR(3, 282, __pyx_L1_error)
6049 __pyx_v_info->format = __pyx_v_f;
6078 __pyx_v_info->format = ((
char *)PyObject_Malloc(0xFF));
6087 (__pyx_v_info->format[0]) =
'^';
6105 __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_8 == ((
char *)NULL))) __PYX_ERR(3, 289, __pyx_L1_error)
6106 __pyx_v_f = __pyx_t_8;
6115 (__pyx_v_f[0]) =
'\x00';
6130 __Pyx_XDECREF(__pyx_t_3);
6131 __Pyx_XDECREF(__pyx_t_7);
6132 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6134 if (__pyx_v_info->obj != NULL) {
6135 __Pyx_GOTREF(__pyx_v_info->obj);
6136 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6140 if (__pyx_v_info->obj == Py_None) {
6141 __Pyx_GOTREF(__pyx_v_info->obj);
6142 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6145 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
6146 __Pyx_RefNannyFinishContext();
6159 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
6160 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6161 __Pyx_RefNannyDeclarations
6162 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
6163 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
6166 __Pyx_RefNannyFinishContext();
6169 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6170 __Pyx_RefNannyDeclarations
6172 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
6181 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
6191 PyObject_Free(__pyx_v_info->format);
6209 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
6219 PyObject_Free(__pyx_v_info->strides);
6239 __Pyx_RefNannyFinishContext();
6250 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6251 PyObject *__pyx_r = NULL;
6252 __Pyx_RefNannyDeclarations
6253 PyObject *__pyx_t_1 = NULL;
6254 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
6263 __Pyx_XDECREF(__pyx_r);
6264 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 776, __pyx_L1_error)
6265 __Pyx_GOTREF(__pyx_t_1);
6266 __pyx_r = __pyx_t_1;
6280 __Pyx_XDECREF(__pyx_t_1);
6281 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6284 __Pyx_XGIVEREF(__pyx_r);
6285 __Pyx_RefNannyFinishContext();
6297 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6298 PyObject *__pyx_r = NULL;
6299 __Pyx_RefNannyDeclarations
6300 PyObject *__pyx_t_1 = NULL;
6301 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
6310 __Pyx_XDECREF(__pyx_r);
6311 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 779, __pyx_L1_error)
6312 __Pyx_GOTREF(__pyx_t_1);
6313 __pyx_r = __pyx_t_1;
6327 __Pyx_XDECREF(__pyx_t_1);
6328 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6331 __Pyx_XGIVEREF(__pyx_r);
6332 __Pyx_RefNannyFinishContext();
6344 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6345 PyObject *__pyx_r = NULL;
6346 __Pyx_RefNannyDeclarations
6347 PyObject *__pyx_t_1 = NULL;
6348 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
6357 __Pyx_XDECREF(__pyx_r);
6358 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 782, __pyx_L1_error)
6359 __Pyx_GOTREF(__pyx_t_1);
6360 __pyx_r = __pyx_t_1;
6374 __Pyx_XDECREF(__pyx_t_1);
6375 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6378 __Pyx_XGIVEREF(__pyx_r);
6379 __Pyx_RefNannyFinishContext();
6391 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6392 PyObject *__pyx_r = NULL;
6393 __Pyx_RefNannyDeclarations
6394 PyObject *__pyx_t_1 = NULL;
6395 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
6404 __Pyx_XDECREF(__pyx_r);
6405 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 785, __pyx_L1_error)
6406 __Pyx_GOTREF(__pyx_t_1);
6407 __pyx_r = __pyx_t_1;
6421 __Pyx_XDECREF(__pyx_t_1);
6422 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6425 __Pyx_XGIVEREF(__pyx_r);
6426 __Pyx_RefNannyFinishContext();
6438 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6439 PyObject *__pyx_r = NULL;
6440 __Pyx_RefNannyDeclarations
6441 PyObject *__pyx_t_1 = NULL;
6442 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
6451 __Pyx_XDECREF(__pyx_r);
6452 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 788, __pyx_L1_error)
6453 __Pyx_GOTREF(__pyx_t_1);
6454 __pyx_r = __pyx_t_1;
6468 __Pyx_XDECREF(__pyx_t_1);
6469 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6472 __Pyx_XGIVEREF(__pyx_r);
6473 __Pyx_RefNannyFinishContext();
6485 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6486 PyObject *__pyx_r = NULL;
6487 __Pyx_RefNannyDeclarations
6489 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
6498 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6508 __Pyx_XDECREF(__pyx_r);
6509 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6510 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6530 __Pyx_XDECREF(__pyx_r);
6531 __Pyx_INCREF(__pyx_empty_tuple);
6532 __pyx_r = __pyx_empty_tuple;
6546 __Pyx_XGIVEREF(__pyx_r);
6547 __Pyx_RefNannyFinishContext();
6559 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
6560 PyArray_Descr *__pyx_v_child = 0;
6561 int __pyx_v_endian_detector;
6562 int __pyx_v_little_endian;
6563 PyObject *__pyx_v_fields = 0;
6564 PyObject *__pyx_v_childname = NULL;
6565 PyObject *__pyx_v_new_offset = NULL;
6566 PyObject *__pyx_v_t = NULL;
6568 __Pyx_RefNannyDeclarations
6569 PyObject *__pyx_t_1 = NULL;
6570 Py_ssize_t __pyx_t_2;
6571 PyObject *__pyx_t_3 = NULL;
6572 PyObject *__pyx_t_4 = NULL;
6578 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
6587 __pyx_v_endian_detector = 1;
6596 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
6605 if (unlikely(__pyx_v_descr->names == Py_None)) {
6606 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
6607 __PYX_ERR(3, 805, __pyx_L1_error)
6609 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6611 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
6612 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 6613 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(3, 805, __pyx_L1_error)
6615 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 805, __pyx_L1_error)
6616 __Pyx_GOTREF(__pyx_t_3);
6618 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
6628 if (unlikely(__pyx_v_descr->fields == Py_None)) {
6629 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6630 __PYX_ERR(3, 806, __pyx_L1_error)
6632 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 806, __pyx_L1_error)
6633 __Pyx_GOTREF(__pyx_t_3);
6634 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 806, __pyx_L1_error)
6635 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
6645 if (likely(__pyx_v_fields != Py_None)) {
6646 PyObject* sequence = __pyx_v_fields;
6647 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6648 if (unlikely(size != 2)) {
6649 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6650 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6651 __PYX_ERR(3, 807, __pyx_L1_error)
6653 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 6654 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6655 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
6656 __Pyx_INCREF(__pyx_t_3);
6657 __Pyx_INCREF(__pyx_t_4);
6659 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 807, __pyx_L1_error)
6660 __Pyx_GOTREF(__pyx_t_3);
6661 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 807, __pyx_L1_error)
6662 __Pyx_GOTREF(__pyx_t_4);
6665 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 807, __pyx_L1_error)
6667 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 807, __pyx_L1_error)
6668 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
6670 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
6680 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 809, __pyx_L1_error)
6681 __Pyx_GOTREF(__pyx_t_4);
6682 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 809, __pyx_L1_error)
6683 __Pyx_GOTREF(__pyx_t_3);
6684 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6685 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(3, 809, __pyx_L1_error)
6686 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6687 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
6688 if (unlikely(__pyx_t_6)) {
6697 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 810, __pyx_L1_error)
6698 __Pyx_GOTREF(__pyx_t_3);
6699 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6700 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6701 __PYX_ERR(3, 810, __pyx_L1_error)
6719 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
6721 goto __pyx_L8_next_or;
6724 __pyx_t_7 = (__pyx_v_little_endian != 0);
6727 __pyx_t_6 = __pyx_t_7;
6728 goto __pyx_L7_bool_binop_done;
6739 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
6742 __pyx_t_6 = __pyx_t_7;
6743 goto __pyx_L7_bool_binop_done;
6745 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
6746 __pyx_t_6 = __pyx_t_7;
6747 __pyx_L7_bool_binop_done:;
6756 if (unlikely(__pyx_t_6)) {
6765 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 814, __pyx_L1_error)
6766 __Pyx_GOTREF(__pyx_t_3);
6767 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6768 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6769 __PYX_ERR(3, 814, __pyx_L1_error)
6788 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 824, __pyx_L1_error)
6789 __Pyx_GOTREF(__pyx_t_3);
6790 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 824, __pyx_L1_error)
6791 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6792 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 824, __pyx_L1_error)
6793 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6794 if (!__pyx_t_6)
break;
6803 (__pyx_v_f[0]) = 0x78;
6812 __pyx_v_f = (__pyx_v_f + 1);
6822 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
6833 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
6842 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
6852 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error)
6853 __Pyx_GOTREF(__pyx_t_4);
6854 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
6864 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
6865 if (unlikely(__pyx_t_6)) {
6874 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error)
6875 __Pyx_GOTREF(__pyx_t_4);
6876 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
6877 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6878 __PYX_ERR(3, 834, __pyx_L1_error)
6896 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error)
6897 __Pyx_GOTREF(__pyx_t_4);
6898 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error)
6899 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6900 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error)
6901 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6903 (__pyx_v_f[0]) = 98;
6914 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error)
6915 __Pyx_GOTREF(__pyx_t_3);
6916 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error)
6917 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6918 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error)
6919 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6921 (__pyx_v_f[0]) = 66;
6932 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error)
6933 __Pyx_GOTREF(__pyx_t_4);
6934 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error)
6935 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6936 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error)
6937 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6939 (__pyx_v_f[0]) = 0x68;
6950 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error)
6951 __Pyx_GOTREF(__pyx_t_3);
6952 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error)
6953 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6954 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error)
6955 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6957 (__pyx_v_f[0]) = 72;
6968 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error)
6969 __Pyx_GOTREF(__pyx_t_4);
6970 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error)
6971 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6972 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error)
6973 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6975 (__pyx_v_f[0]) = 0x69;
6986 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error)
6987 __Pyx_GOTREF(__pyx_t_3);
6988 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error)
6989 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6990 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error)
6991 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6993 (__pyx_v_f[0]) = 73;
7004 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 843, __pyx_L1_error)
7005 __Pyx_GOTREF(__pyx_t_4);
7006 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 843, __pyx_L1_error)
7007 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7008 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 843, __pyx_L1_error)
7009 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7011 (__pyx_v_f[0]) = 0x6C;
7022 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error)
7023 __Pyx_GOTREF(__pyx_t_3);
7024 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __pyx_L1_error)
7025 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7026 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 844, __pyx_L1_error)
7027 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7029 (__pyx_v_f[0]) = 76;
7040 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 845, __pyx_L1_error)
7041 __Pyx_GOTREF(__pyx_t_4);
7042 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 845, __pyx_L1_error)
7043 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7044 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 845, __pyx_L1_error)
7045 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7047 (__pyx_v_f[0]) = 0x71;
7058 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 846, __pyx_L1_error)
7059 __Pyx_GOTREF(__pyx_t_3);
7060 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 846, __pyx_L1_error)
7061 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7062 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 846, __pyx_L1_error)
7063 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7065 (__pyx_v_f[0]) = 81;
7076 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 847, __pyx_L1_error)
7077 __Pyx_GOTREF(__pyx_t_4);
7078 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 847, __pyx_L1_error)
7079 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7080 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 847, __pyx_L1_error)
7081 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7083 (__pyx_v_f[0]) = 0x66;
7094 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 848, __pyx_L1_error)
7095 __Pyx_GOTREF(__pyx_t_3);
7096 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 848, __pyx_L1_error)
7097 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7098 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 848, __pyx_L1_error)
7099 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7101 (__pyx_v_f[0]) = 0x64;
7112 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 849, __pyx_L1_error)
7113 __Pyx_GOTREF(__pyx_t_4);
7114 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 849, __pyx_L1_error)
7115 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7116 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 849, __pyx_L1_error)
7117 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7119 (__pyx_v_f[0]) = 0x67;
7130 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 850, __pyx_L1_error)
7131 __Pyx_GOTREF(__pyx_t_3);
7132 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 850, __pyx_L1_error)
7133 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7134 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 850, __pyx_L1_error)
7135 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7137 (__pyx_v_f[0]) = 90;
7138 (__pyx_v_f[1]) = 0x66;
7139 __pyx_v_f = (__pyx_v_f + 1);
7150 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 851, __pyx_L1_error)
7151 __Pyx_GOTREF(__pyx_t_4);
7152 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
7153 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7154 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 851, __pyx_L1_error)
7155 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7157 (__pyx_v_f[0]) = 90;
7158 (__pyx_v_f[1]) = 0x64;
7159 __pyx_v_f = (__pyx_v_f + 1);
7170 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
7171 __Pyx_GOTREF(__pyx_t_3);
7172 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 852, __pyx_L1_error)
7173 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7174 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 852, __pyx_L1_error)
7175 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7177 (__pyx_v_f[0]) = 90;
7178 (__pyx_v_f[1]) = 0x67;
7179 __pyx_v_f = (__pyx_v_f + 1);
7190 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
7191 __Pyx_GOTREF(__pyx_t_4);
7192 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
7193 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7194 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 853, __pyx_L1_error)
7195 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7196 if (likely(__pyx_t_6)) {
7197 (__pyx_v_f[0]) = 79;
7209 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
7210 __Pyx_GOTREF(__pyx_t_3);
7211 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
7212 __Pyx_GOTREF(__pyx_t_4);
7213 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7214 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7215 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7216 __PYX_ERR(3, 855, __pyx_L1_error)
7227 __pyx_v_f = (__pyx_v_f + 1);
7247 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(3, 860, __pyx_L1_error)
7248 __pyx_v_f = __pyx_t_9;
7260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7269 __pyx_r = __pyx_v_f;
7282 __Pyx_XDECREF(__pyx_t_1);
7283 __Pyx_XDECREF(__pyx_t_3);
7284 __Pyx_XDECREF(__pyx_t_4);
7285 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7288 __Pyx_XDECREF((PyObject *)__pyx_v_child);
7289 __Pyx_XDECREF(__pyx_v_fields);
7290 __Pyx_XDECREF(__pyx_v_childname);
7291 __Pyx_XDECREF(__pyx_v_new_offset);
7292 __Pyx_XDECREF(__pyx_v_t);
7293 __Pyx_RefNannyFinishContext();
7305 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7306 PyObject *__pyx_v_baseptr;
7307 __Pyx_RefNannyDeclarations
7310 __Pyx_RefNannySetupContext(
"set_array_base", 0);
7319 __pyx_t_1 = (__pyx_v_base == Py_None);
7320 __pyx_t_2 = (__pyx_t_1 != 0);
7330 __pyx_v_baseptr = NULL;
7350 Py_INCREF(__pyx_v_base);
7359 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
7370 Py_XDECREF(__pyx_v_arr->base);
7379 __pyx_v_arr->base = __pyx_v_baseptr;
7390 __Pyx_RefNannyFinishContext();
7401 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7402 PyObject *__pyx_r = NULL;
7403 __Pyx_RefNannyDeclarations
7405 __Pyx_RefNannySetupContext(
"get_array_base", 0);
7414 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
7424 __Pyx_XDECREF(__pyx_r);
7425 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7445 __Pyx_XDECREF(__pyx_r);
7446 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
7447 __pyx_r = ((PyObject *)__pyx_v_arr->base);
7461 __Pyx_XGIVEREF(__pyx_r);
7462 __Pyx_RefNannyFinishContext();
7474 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
7476 __Pyx_RefNannyDeclarations
7477 PyObject *__pyx_t_1 = NULL;
7478 PyObject *__pyx_t_2 = NULL;
7479 PyObject *__pyx_t_3 = NULL;
7481 PyObject *__pyx_t_5 = NULL;
7482 PyObject *__pyx_t_6 = NULL;
7483 PyObject *__pyx_t_7 = NULL;
7484 PyObject *__pyx_t_8 = NULL;
7485 __Pyx_RefNannySetupContext(
"import_array", 0);
7495 __Pyx_PyThreadState_declare
7496 __Pyx_PyThreadState_assign
7497 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7498 __Pyx_XGOTREF(__pyx_t_1);
7499 __Pyx_XGOTREF(__pyx_t_2);
7500 __Pyx_XGOTREF(__pyx_t_3);
7510 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 998, __pyx_L3_error)
7520 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7521 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7522 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7523 goto __pyx_L8_try_end;
7533 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7535 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7536 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 999, __pyx_L5_except_error)
7537 __Pyx_GOTREF(__pyx_t_5);
7538 __Pyx_GOTREF(__pyx_t_6);
7539 __Pyx_GOTREF(__pyx_t_7);
7548 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1000, __pyx_L5_except_error)
7549 __Pyx_GOTREF(__pyx_t_8);
7550 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7551 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7552 __PYX_ERR(3, 1000, __pyx_L5_except_error)
7554 goto __pyx_L5_except_error;
7555 __pyx_L5_except_error:;
7564 __Pyx_XGIVEREF(__pyx_t_1);
7565 __Pyx_XGIVEREF(__pyx_t_2);
7566 __Pyx_XGIVEREF(__pyx_t_3);
7567 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7568 goto __pyx_L1_error;
7584 __Pyx_XDECREF(__pyx_t_5);
7585 __Pyx_XDECREF(__pyx_t_6);
7586 __Pyx_XDECREF(__pyx_t_7);
7587 __Pyx_XDECREF(__pyx_t_8);
7588 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7591 __Pyx_RefNannyFinishContext();
7603 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
7605 __Pyx_RefNannyDeclarations
7606 PyObject *__pyx_t_1 = NULL;
7607 PyObject *__pyx_t_2 = NULL;
7608 PyObject *__pyx_t_3 = NULL;
7610 PyObject *__pyx_t_5 = NULL;
7611 PyObject *__pyx_t_6 = NULL;
7612 PyObject *__pyx_t_7 = NULL;
7613 PyObject *__pyx_t_8 = NULL;
7614 __Pyx_RefNannySetupContext(
"import_umath", 0);
7624 __Pyx_PyThreadState_declare
7625 __Pyx_PyThreadState_assign
7626 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7627 __Pyx_XGOTREF(__pyx_t_1);
7628 __Pyx_XGOTREF(__pyx_t_2);
7629 __Pyx_XGOTREF(__pyx_t_3);
7639 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 1004, __pyx_L3_error)
7649 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7650 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7651 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7652 goto __pyx_L8_try_end;
7662 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7664 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7665 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1005, __pyx_L5_except_error)
7666 __Pyx_GOTREF(__pyx_t_5);
7667 __Pyx_GOTREF(__pyx_t_6);
7668 __Pyx_GOTREF(__pyx_t_7);
7677 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1006, __pyx_L5_except_error)
7678 __Pyx_GOTREF(__pyx_t_8);
7679 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7680 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7681 __PYX_ERR(3, 1006, __pyx_L5_except_error)
7683 goto __pyx_L5_except_error;
7684 __pyx_L5_except_error:;
7693 __Pyx_XGIVEREF(__pyx_t_1);
7694 __Pyx_XGIVEREF(__pyx_t_2);
7695 __Pyx_XGIVEREF(__pyx_t_3);
7696 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7697 goto __pyx_L1_error;
7713 __Pyx_XDECREF(__pyx_t_5);
7714 __Pyx_XDECREF(__pyx_t_6);
7715 __Pyx_XDECREF(__pyx_t_7);
7716 __Pyx_XDECREF(__pyx_t_8);
7717 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7720 __Pyx_RefNannyFinishContext();
7732 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
7734 __Pyx_RefNannyDeclarations
7735 PyObject *__pyx_t_1 = NULL;
7736 PyObject *__pyx_t_2 = NULL;
7737 PyObject *__pyx_t_3 = NULL;
7739 PyObject *__pyx_t_5 = NULL;
7740 PyObject *__pyx_t_6 = NULL;
7741 PyObject *__pyx_t_7 = NULL;
7742 PyObject *__pyx_t_8 = NULL;
7743 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
7753 __Pyx_PyThreadState_declare
7754 __Pyx_PyThreadState_assign
7755 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7756 __Pyx_XGOTREF(__pyx_t_1);
7757 __Pyx_XGOTREF(__pyx_t_2);
7758 __Pyx_XGOTREF(__pyx_t_3);
7768 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 1010, __pyx_L3_error)
7778 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7779 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7780 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7781 goto __pyx_L8_try_end;
7790 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7792 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7793 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1011, __pyx_L5_except_error)
7794 __Pyx_GOTREF(__pyx_t_5);
7795 __Pyx_GOTREF(__pyx_t_6);
7796 __Pyx_GOTREF(__pyx_t_7);
7803 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1012, __pyx_L5_except_error)
7804 __Pyx_GOTREF(__pyx_t_8);
7805 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7806 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7807 __PYX_ERR(3, 1012, __pyx_L5_except_error)
7809 goto __pyx_L5_except_error;
7810 __pyx_L5_except_error:;
7819 __Pyx_XGIVEREF(__pyx_t_1);
7820 __Pyx_XGIVEREF(__pyx_t_2);
7821 __Pyx_XGIVEREF(__pyx_t_3);
7822 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7823 goto __pyx_L1_error;
7839 __Pyx_XDECREF(__pyx_t_5);
7840 __Pyx_XDECREF(__pyx_t_6);
7841 __Pyx_XDECREF(__pyx_t_7);
7842 __Pyx_XDECREF(__pyx_t_8);
7843 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7846 __Pyx_RefNannyFinishContext();
7859 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7860 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7861 PyObject *__pyx_v_shape = 0;
7862 Py_ssize_t __pyx_v_itemsize;
7863 PyObject *__pyx_v_format = 0;
7864 PyObject *__pyx_v_mode = 0;
7865 int __pyx_v_allocate_buffer;
7867 __Pyx_RefNannyDeclarations
7868 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
7870 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
7871 PyObject* values[5] = {0,0,0,0,0};
7872 values[3] = ((PyObject *)__pyx_n_s_c);
7873 if (unlikely(__pyx_kwds)) {
7875 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7877 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7879 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7881 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7883 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7885 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7888 default:
goto __pyx_L5_argtuple_error;
7890 kw_args = PyDict_Size(__pyx_kwds);
7893 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7894 else goto __pyx_L5_argtuple_error;
7897 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7899 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 121, __pyx_L3_error)
7903 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7905 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 121, __pyx_L3_error)
7910 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7911 if (value) { values[3] = value; kw_args--; }
7916 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7917 if (value) { values[4] = value; kw_args--; }
7920 if (unlikely(kw_args > 0)) {
7921 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 121, __pyx_L3_error)
7924 switch (PyTuple_GET_SIZE(__pyx_args)) {
7925 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7927 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7929 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7930 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7931 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7933 default:
goto __pyx_L5_argtuple_error;
7936 __pyx_v_shape = ((PyObject*)values[0]);
7937 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error)
7938 __pyx_v_format = values[2];
7939 __pyx_v_mode = values[3];
7941 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error)
7951 __pyx_v_allocate_buffer = ((int)1);
7954 goto __pyx_L4_argument_unpacking_done;
7955 __pyx_L5_argtuple_error:;
7956 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 121, __pyx_L3_error)
7958 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7959 __Pyx_RefNannyFinishContext();
7961 __pyx_L4_argument_unpacking_done:;
7962 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(0, 121, __pyx_L1_error)
7963 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7964 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(0, 121, __pyx_L1_error)
7966 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
7981 __Pyx_RefNannyFinishContext();
7985 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
7987 Py_ssize_t __pyx_v_i;
7988 Py_ssize_t __pyx_v_dim;
7989 PyObject **__pyx_v_p;
7992 __Pyx_RefNannyDeclarations
7993 Py_ssize_t __pyx_t_1;
7995 PyObject *__pyx_t_3 = NULL;
7997 PyObject *__pyx_t_5 = NULL;
8000 Py_ssize_t __pyx_t_8;
8001 PyObject *__pyx_t_9 = NULL;
8002 PyObject *__pyx_t_10 = NULL;
8003 Py_ssize_t __pyx_t_11;
8004 __Pyx_RefNannySetupContext(
"__cinit__", 0);
8005 __Pyx_INCREF(__pyx_v_format);
8014 if (unlikely(__pyx_v_shape == Py_None)) {
8015 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
8016 __PYX_ERR(0, 128, __pyx_L1_error)
8018 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 128, __pyx_L1_error)
8019 __pyx_v_self->ndim = ((int)__pyx_t_1);
8028 __pyx_v_self->itemsize = __pyx_v_itemsize;
8037 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8038 if (unlikely(__pyx_t_2)) {
8047 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error)
8048 __Pyx_GOTREF(__pyx_t_3);
8049 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8050 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8051 __PYX_ERR(0, 132, __pyx_L1_error)
8069 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8070 if (unlikely(__pyx_t_2)) {
8079 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
8080 __Pyx_GOTREF(__pyx_t_3);
8081 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8082 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8083 __PYX_ERR(0, 135, __pyx_L1_error)
8101 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8102 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8112 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error)
8113 __Pyx_GOTREF(__pyx_t_3);
8114 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error)
8115 __Pyx_GOTREF(__pyx_t_5);
8116 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8117 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
8136 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(0, 139, __pyx_L1_error)
8137 __pyx_t_5 = __pyx_v_format;
8138 __Pyx_INCREF(__pyx_t_5);
8139 __Pyx_GIVEREF(__pyx_t_5);
8140 __Pyx_GOTREF(__pyx_v_self->_format);
8141 __Pyx_DECREF(__pyx_v_self->_format);
8142 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
8152 if (unlikely(__pyx_v_self->_format == Py_None)) {
8153 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
8154 __PYX_ERR(0, 140, __pyx_L1_error)
8156 __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error)
8157 __pyx_v_self->format = __pyx_t_6;
8166 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8175 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8184 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8185 if (unlikely(__pyx_t_4)) {
8194 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
8195 __Pyx_GOTREF(__pyx_t_5);
8196 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
8197 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8198 __PYX_ERR(0, 147, __pyx_L1_error)
8217 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
8219 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
8220 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 8221 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(0, 150, __pyx_L1_error)
8223 __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
8224 __Pyx_GOTREF(__pyx_t_3);
8226 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L1_error)
8227 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8228 __pyx_v_dim = __pyx_t_8;
8229 __pyx_v_idx = __pyx_t_7;
8230 __pyx_t_7 = (__pyx_t_7 + 1);
8239 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8240 if (unlikely(__pyx_t_4)) {
8249 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
8250 __Pyx_GOTREF(__pyx_t_3);
8251 __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error)
8252 __Pyx_GOTREF(__pyx_t_9);
8253 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 152, __pyx_L1_error)
8254 __Pyx_GOTREF(__pyx_t_10);
8255 __Pyx_GIVEREF(__pyx_t_3);
8256 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
8257 __Pyx_GIVEREF(__pyx_t_9);
8258 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
8261 __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error)
8262 __Pyx_GOTREF(__pyx_t_9);
8263 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8264 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 152, __pyx_L1_error)
8265 __Pyx_GOTREF(__pyx_t_10);
8266 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8267 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8268 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8269 __PYX_ERR(0, 152, __pyx_L1_error)
8287 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8297 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8306 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
8316 __pyx_v_order =
'F';
8325 __Pyx_INCREF(__pyx_n_u_fortran);
8326 __Pyx_GIVEREF(__pyx_n_u_fortran);
8327 __Pyx_GOTREF(__pyx_v_self->mode);
8328 __Pyx_DECREF(__pyx_v_self->mode);
8329 __pyx_v_self->mode = __pyx_n_u_fortran;
8348 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
8349 if (likely(__pyx_t_4)) {
8358 __pyx_v_order =
'C';
8367 __Pyx_INCREF(__pyx_n_u_c);
8368 __Pyx_GIVEREF(__pyx_n_u_c);
8369 __Pyx_GOTREF(__pyx_v_self->mode);
8370 __Pyx_DECREF(__pyx_v_self->mode);
8371 __pyx_v_self->mode = __pyx_n_u_c;
8391 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
8392 __Pyx_GOTREF(__pyx_t_5);
8393 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 163, __pyx_L1_error)
8394 __Pyx_GOTREF(__pyx_t_10);
8395 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8396 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8397 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8398 __PYX_ERR(0, 163, __pyx_L1_error)
8409 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8418 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8427 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 169, __pyx_L1_error)
8428 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 169, __pyx_L1_error)
8429 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8430 __pyx_v_self->dtype_is_object = __pyx_t_4;
8439 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8449 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
8458 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8459 if (unlikely(__pyx_t_4)) {
8468 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 175, __pyx_L1_error)
8469 __Pyx_GOTREF(__pyx_t_10);
8470 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8471 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8472 __PYX_ERR(0, 175, __pyx_L1_error)
8490 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8500 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8509 if (unlikely(__pyx_v_itemsize == 0)) {
8510 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
8511 __PYX_ERR(0, 179, __pyx_L1_error)
8513 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8514 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
8515 __PYX_ERR(0, 179, __pyx_L1_error)
8517 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8518 __pyx_t_8 = __pyx_t_1;
8519 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
8520 __pyx_v_i = __pyx_t_11;
8529 (__pyx_v_p[__pyx_v_i]) = Py_None;
8571 __Pyx_XDECREF(__pyx_t_3);
8572 __Pyx_XDECREF(__pyx_t_5);
8573 __Pyx_XDECREF(__pyx_t_9);
8574 __Pyx_XDECREF(__pyx_t_10);
8575 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8578 __Pyx_XDECREF(__pyx_v_format);
8579 __Pyx_RefNannyFinishContext();
8592 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
8593 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8595 __Pyx_RefNannyDeclarations
8596 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
8597 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
8600 __Pyx_RefNannyFinishContext();
8604 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8605 int __pyx_v_bufmode;
8607 __Pyx_RefNannyDeclarations
8610 PyObject *__pyx_t_3 = NULL;
8612 Py_ssize_t __pyx_t_5;
8614 Py_ssize_t *__pyx_t_7;
8615 if (__pyx_v_info == NULL) {
8616 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
8619 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
8620 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8621 __Pyx_GIVEREF(__pyx_v_info->obj);
8630 __pyx_v_bufmode = -1;
8639 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 186, __pyx_L1_error)
8640 __pyx_t_2 = (__pyx_t_1 != 0);
8650 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8669 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 188, __pyx_L1_error)
8670 __pyx_t_1 = (__pyx_t_2 != 0);
8680 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8699 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8700 if (unlikely(__pyx_t_1)) {
8709 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
8710 __Pyx_GOTREF(__pyx_t_3);
8711 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8712 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8713 __PYX_ERR(0, 191, __pyx_L1_error)
8731 __pyx_t_4 = __pyx_v_self->data;
8732 __pyx_v_info->buf = __pyx_t_4;
8741 __pyx_t_5 = __pyx_v_self->len;
8742 __pyx_v_info->len = __pyx_t_5;
8751 __pyx_t_6 = __pyx_v_self->ndim;
8752 __pyx_v_info->ndim = __pyx_t_6;
8761 __pyx_t_7 = __pyx_v_self->_shape;
8762 __pyx_v_info->shape = __pyx_t_7;
8771 __pyx_t_7 = __pyx_v_self->_strides;
8772 __pyx_v_info->strides = __pyx_t_7;
8781 __pyx_v_info->suboffsets = NULL;
8790 __pyx_t_5 = __pyx_v_self->itemsize;
8791 __pyx_v_info->itemsize = __pyx_t_5;
8800 __pyx_v_info->readonly = 0;
8809 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8819 __pyx_t_4 = __pyx_v_self->format;
8820 __pyx_v_info->format = __pyx_t_4;
8840 __pyx_v_info->format = NULL;
8851 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8852 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8853 __Pyx_GOTREF(__pyx_v_info->obj);
8854 __Pyx_DECREF(__pyx_v_info->obj);
8855 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8869 __Pyx_XDECREF(__pyx_t_3);
8870 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8872 if (__pyx_v_info->obj != NULL) {
8873 __Pyx_GOTREF(__pyx_v_info->obj);
8874 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8878 if (__pyx_v_info->obj == Py_None) {
8879 __Pyx_GOTREF(__pyx_v_info->obj);
8880 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8883 __Pyx_RefNannyFinishContext();
8896 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
8897 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8898 __Pyx_RefNannyDeclarations
8899 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
8900 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
8903 __Pyx_RefNannyFinishContext();
8906 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
8907 __Pyx_RefNannyDeclarations
8909 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
8918 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8928 __pyx_v_self->callback_free_data(__pyx_v_self->data);
8947 __pyx_t_1 = (__pyx_v_self->free_data != 0);
8957 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8967 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8985 free(__pyx_v_self->data);
9004 PyObject_Free(__pyx_v_self->_shape);
9015 __Pyx_RefNannyFinishContext();
9027 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
9028 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9029 PyObject *__pyx_r = 0;
9030 __Pyx_RefNannyDeclarations
9031 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
9032 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
9035 __Pyx_RefNannyFinishContext();
9039 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
9040 PyObject *__pyx_r = NULL;
9041 __Pyx_RefNannyDeclarations
9042 PyObject *__pyx_t_1 = NULL;
9043 __Pyx_RefNannySetupContext(
"__get__", 0);
9052 __Pyx_XDECREF(__pyx_r);
9053 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
9054 __Pyx_GOTREF(__pyx_t_1);
9055 __pyx_r = __pyx_t_1;
9069 __Pyx_XDECREF(__pyx_t_1);
9070 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9073 __Pyx_XGIVEREF(__pyx_r);
9074 __Pyx_RefNannyFinishContext();
9086 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
9088 PyObject *__pyx_r = NULL;
9089 __Pyx_RefNannyDeclarations
9090 PyObject *__pyx_t_1 = NULL;
9091 PyObject *__pyx_t_2 = NULL;
9092 PyObject *__pyx_t_3 = NULL;
9093 __Pyx_RefNannySetupContext(
"get_memview", 0);
9102 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9111 __Pyx_XDECREF(__pyx_r);
9112 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
9113 __Pyx_GOTREF(__pyx_t_1);
9114 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
9115 __Pyx_GOTREF(__pyx_t_2);
9116 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
9117 __Pyx_GOTREF(__pyx_t_3);
9118 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9119 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9120 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9121 __Pyx_GIVEREF(__pyx_t_1);
9122 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9123 __Pyx_GIVEREF(__pyx_t_2);
9124 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9127 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
9128 __Pyx_GOTREF(__pyx_t_2);
9129 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9130 __pyx_r = __pyx_t_2;
9144 __Pyx_XDECREF(__pyx_t_1);
9145 __Pyx_XDECREF(__pyx_t_2);
9146 __Pyx_XDECREF(__pyx_t_3);
9147 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9150 __Pyx_XGIVEREF(__pyx_r);
9151 __Pyx_RefNannyFinishContext();
9164 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
9165 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9167 __Pyx_RefNannyDeclarations
9168 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
9169 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
9172 __Pyx_RefNannyFinishContext();
9176 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
9178 __Pyx_RefNannyDeclarations
9179 __Pyx_RefNannySetupContext(
"__len__", 0);
9188 __pyx_r = (__pyx_v_self->_shape[0]);
9201 __Pyx_RefNannyFinishContext();
9214 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
9215 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9216 PyObject *__pyx_r = 0;
9217 __Pyx_RefNannyDeclarations
9218 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
9219 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9222 __Pyx_RefNannyFinishContext();
9226 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9227 PyObject *__pyx_r = NULL;
9228 __Pyx_RefNannyDeclarations
9229 PyObject *__pyx_t_1 = NULL;
9230 PyObject *__pyx_t_2 = NULL;
9231 __Pyx_RefNannySetupContext(
"__getattr__", 0);
9240 __Pyx_XDECREF(__pyx_r);
9241 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
9242 __Pyx_GOTREF(__pyx_t_1);
9243 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
9244 __Pyx_GOTREF(__pyx_t_2);
9245 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9246 __pyx_r = __pyx_t_2;
9260 __Pyx_XDECREF(__pyx_t_1);
9261 __Pyx_XDECREF(__pyx_t_2);
9262 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9265 __Pyx_XGIVEREF(__pyx_r);
9266 __Pyx_RefNannyFinishContext();
9279 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
9280 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9281 PyObject *__pyx_r = 0;
9282 __Pyx_RefNannyDeclarations
9283 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
9284 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9287 __Pyx_RefNannyFinishContext();
9291 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9292 PyObject *__pyx_r = NULL;
9293 __Pyx_RefNannyDeclarations
9294 PyObject *__pyx_t_1 = NULL;
9295 PyObject *__pyx_t_2 = NULL;
9296 __Pyx_RefNannySetupContext(
"__getitem__", 0);
9305 __Pyx_XDECREF(__pyx_r);
9306 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
9307 __Pyx_GOTREF(__pyx_t_1);
9308 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
9309 __Pyx_GOTREF(__pyx_t_2);
9310 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9311 __pyx_r = __pyx_t_2;
9325 __Pyx_XDECREF(__pyx_t_1);
9326 __Pyx_XDECREF(__pyx_t_2);
9327 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9330 __Pyx_XGIVEREF(__pyx_r);
9331 __Pyx_RefNannyFinishContext();
9344 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
9345 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9347 __Pyx_RefNannyDeclarations
9348 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
9349 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9352 __Pyx_RefNannyFinishContext();
9356 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9358 __Pyx_RefNannyDeclarations
9359 PyObject *__pyx_t_1 = NULL;
9360 __Pyx_RefNannySetupContext(
"__setitem__", 0);
9369 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
9370 __Pyx_GOTREF(__pyx_t_1);
9371 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(0, 239, __pyx_L1_error)
9372 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9386 __Pyx_XDECREF(__pyx_t_1);
9387 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9390 __Pyx_RefNannyFinishContext();
9401 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9402 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
9403 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9404 PyObject *__pyx_r = 0;
9405 __Pyx_RefNannyDeclarations
9406 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9407 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
9410 __Pyx_RefNannyFinishContext();
9414 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
9415 PyObject *__pyx_r = NULL;
9416 __Pyx_RefNannyDeclarations
9417 PyObject *__pyx_t_1 = NULL;
9418 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9426 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
9427 __Pyx_GOTREF(__pyx_t_1);
9428 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9429 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9430 __PYX_ERR(0, 2, __pyx_L1_error)
9440 __Pyx_XDECREF(__pyx_t_1);
9441 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9443 __Pyx_XGIVEREF(__pyx_r);
9444 __Pyx_RefNannyFinishContext();
9456 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
9457 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
9458 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9459 PyObject *__pyx_r = 0;
9460 __Pyx_RefNannyDeclarations
9461 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
9462 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9465 __Pyx_RefNannyFinishContext();
9469 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9470 PyObject *__pyx_r = NULL;
9471 __Pyx_RefNannyDeclarations
9472 PyObject *__pyx_t_1 = NULL;
9473 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
9480 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
9481 __Pyx_GOTREF(__pyx_t_1);
9482 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9483 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9484 __PYX_ERR(0, 4, __pyx_L1_error)
9495 __Pyx_XDECREF(__pyx_t_1);
9496 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9498 __Pyx_XGIVEREF(__pyx_r);
9499 __Pyx_RefNannyFinishContext();
9511 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
9512 struct __pyx_array_obj *__pyx_v_result = 0;
9513 struct __pyx_array_obj *__pyx_r = NULL;
9514 __Pyx_RefNannyDeclarations
9516 PyObject *__pyx_t_2 = NULL;
9517 PyObject *__pyx_t_3 = NULL;
9518 PyObject *__pyx_t_4 = NULL;
9519 PyObject *__pyx_t_5 = NULL;
9520 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
9529 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9539 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
9540 __Pyx_GOTREF(__pyx_t_2);
9541 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
9542 __Pyx_GOTREF(__pyx_t_3);
9543 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
9544 __Pyx_GOTREF(__pyx_t_4);
9545 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
9546 __Pyx_GOTREF(__pyx_t_5);
9547 __Pyx_INCREF(__pyx_v_shape);
9548 __Pyx_GIVEREF(__pyx_v_shape);
9549 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9550 __Pyx_GIVEREF(__pyx_t_2);
9551 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9552 __Pyx_GIVEREF(__pyx_t_3);
9553 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9554 __Pyx_GIVEREF(__pyx_t_4);
9555 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9559 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
9560 __Pyx_GOTREF(__pyx_t_4);
9561 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9562 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
9583 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
9584 __Pyx_GOTREF(__pyx_t_4);
9585 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
9586 __Pyx_GOTREF(__pyx_t_5);
9587 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
9588 __Pyx_GOTREF(__pyx_t_3);
9589 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
9590 __Pyx_GOTREF(__pyx_t_2);
9591 __Pyx_INCREF(__pyx_v_shape);
9592 __Pyx_GIVEREF(__pyx_v_shape);
9593 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9594 __Pyx_GIVEREF(__pyx_t_4);
9595 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9596 __Pyx_GIVEREF(__pyx_t_5);
9597 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9598 __Pyx_GIVEREF(__pyx_t_3);
9599 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9611 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
9612 __Pyx_GOTREF(__pyx_t_3);
9613 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
9622 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
9623 __Pyx_GOTREF(__pyx_t_5);
9624 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9625 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9626 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
9636 __pyx_v_result->data = __pyx_v_buf;
9647 __Pyx_XDECREF(((PyObject *)__pyx_r));
9648 __Pyx_INCREF(((PyObject *)__pyx_v_result));
9649 __pyx_r = __pyx_v_result;
9662 __Pyx_XDECREF(__pyx_t_2);
9663 __Pyx_XDECREF(__pyx_t_3);
9664 __Pyx_XDECREF(__pyx_t_4);
9665 __Pyx_XDECREF(__pyx_t_5);
9666 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9669 __Pyx_XDECREF((PyObject *)__pyx_v_result);
9670 __Pyx_XGIVEREF((PyObject *)__pyx_r);
9671 __Pyx_RefNannyFinishContext();
9684 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9685 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9686 PyObject *__pyx_v_name = 0;
9688 __Pyx_RefNannyDeclarations
9689 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
9691 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9692 PyObject* values[1] = {0};
9693 if (unlikely(__pyx_kwds)) {
9695 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9697 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9700 default:
goto __pyx_L5_argtuple_error;
9702 kw_args = PyDict_Size(__pyx_kwds);
9705 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9706 else goto __pyx_L5_argtuple_error;
9708 if (unlikely(kw_args > 0)) {
9709 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 280, __pyx_L3_error)
9711 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9712 goto __pyx_L5_argtuple_error;
9714 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9716 __pyx_v_name = values[0];
9718 goto __pyx_L4_argument_unpacking_done;
9719 __pyx_L5_argtuple_error:;
9720 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 280, __pyx_L3_error)
9722 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9723 __Pyx_RefNannyFinishContext();
9725 __pyx_L4_argument_unpacking_done:;
9726 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9729 __Pyx_RefNannyFinishContext();
9733 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9735 __Pyx_RefNannyDeclarations
9736 __Pyx_RefNannySetupContext(
"__init__", 0);
9745 __Pyx_INCREF(__pyx_v_name);
9746 __Pyx_GIVEREF(__pyx_v_name);
9747 __Pyx_GOTREF(__pyx_v_self->name);
9748 __Pyx_DECREF(__pyx_v_self->name);
9749 __pyx_v_self->name = __pyx_v_name;
9761 __Pyx_RefNannyFinishContext();
9774 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
9775 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9776 PyObject *__pyx_r = 0;
9777 __Pyx_RefNannyDeclarations
9778 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
9779 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9782 __Pyx_RefNannyFinishContext();
9786 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9787 PyObject *__pyx_r = NULL;
9788 __Pyx_RefNannyDeclarations
9789 __Pyx_RefNannySetupContext(
"__repr__", 0);
9798 __Pyx_XDECREF(__pyx_r);
9799 __Pyx_INCREF(__pyx_v_self->name);
9800 __pyx_r = __pyx_v_self->name;
9813 __Pyx_XGIVEREF(__pyx_r);
9814 __Pyx_RefNannyFinishContext();
9825 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9826 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
9827 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9828 PyObject *__pyx_r = 0;
9829 __Pyx_RefNannyDeclarations
9830 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9831 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9834 __Pyx_RefNannyFinishContext();
9838 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9839 int __pyx_v_use_setstate;
9840 PyObject *__pyx_v_state = NULL;
9841 PyObject *__pyx_v__dict = NULL;
9842 PyObject *__pyx_r = NULL;
9843 __Pyx_RefNannyDeclarations
9844 PyObject *__pyx_t_1 = NULL;
9847 PyObject *__pyx_t_4 = NULL;
9848 PyObject *__pyx_t_5 = NULL;
9849 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9858 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
9859 __Pyx_GOTREF(__pyx_t_1);
9860 __Pyx_INCREF(__pyx_v_self->name);
9861 __Pyx_GIVEREF(__pyx_v_self->name);
9862 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9863 __pyx_v_state = ((PyObject*)__pyx_t_1);
9873 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
9874 __Pyx_GOTREF(__pyx_t_1);
9875 __pyx_v__dict = __pyx_t_1;
9885 __pyx_t_2 = (__pyx_v__dict != Py_None);
9886 __pyx_t_3 = (__pyx_t_2 != 0);
9896 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
9897 __Pyx_GOTREF(__pyx_t_1);
9898 __Pyx_INCREF(__pyx_v__dict);
9899 __Pyx_GIVEREF(__pyx_v__dict);
9900 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9901 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
9902 __Pyx_GOTREF(__pyx_t_4);
9903 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9904 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9914 __pyx_v_use_setstate = 1;
9934 __pyx_t_3 = (__pyx_v_self->name != Py_None);
9935 __pyx_v_use_setstate = __pyx_t_3;
9946 __pyx_t_3 = (__pyx_v_use_setstate != 0);
9956 __Pyx_XDECREF(__pyx_r);
9957 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error)
9958 __Pyx_GOTREF(__pyx_t_4);
9959 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
9960 __Pyx_GOTREF(__pyx_t_1);
9961 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9962 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9963 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9964 __Pyx_INCREF(__pyx_int_184977713);
9965 __Pyx_GIVEREF(__pyx_int_184977713);
9966 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9967 __Pyx_INCREF(Py_None);
9968 __Pyx_GIVEREF(Py_None);
9969 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9970 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 11, __pyx_L1_error)
9971 __Pyx_GOTREF(__pyx_t_5);
9972 __Pyx_GIVEREF(__pyx_t_4);
9973 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9974 __Pyx_GIVEREF(__pyx_t_1);
9975 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9976 __Pyx_INCREF(__pyx_v_state);
9977 __Pyx_GIVEREF(__pyx_v_state);
9978 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9981 __pyx_r = __pyx_t_5;
10002 __Pyx_XDECREF(__pyx_r);
10003 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
10004 __Pyx_GOTREF(__pyx_t_5);
10005 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
10006 __Pyx_GOTREF(__pyx_t_1);
10007 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10008 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10009 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10010 __Pyx_INCREF(__pyx_int_184977713);
10011 __Pyx_GIVEREF(__pyx_int_184977713);
10012 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10013 __Pyx_INCREF(__pyx_v_state);
10014 __Pyx_GIVEREF(__pyx_v_state);
10015 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10016 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error)
10017 __Pyx_GOTREF(__pyx_t_4);
10018 __Pyx_GIVEREF(__pyx_t_5);
10019 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10020 __Pyx_GIVEREF(__pyx_t_1);
10021 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10024 __pyx_r = __pyx_t_4;
10037 __Pyx_XDECREF(__pyx_t_1);
10038 __Pyx_XDECREF(__pyx_t_4);
10039 __Pyx_XDECREF(__pyx_t_5);
10040 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10043 __Pyx_XDECREF(__pyx_v_state);
10044 __Pyx_XDECREF(__pyx_v__dict);
10045 __Pyx_XGIVEREF(__pyx_r);
10046 __Pyx_RefNannyFinishContext();
10058 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10059 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
10060 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10061 PyObject *__pyx_r = 0;
10062 __Pyx_RefNannyDeclarations
10063 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10064 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10067 __Pyx_RefNannyFinishContext();
10071 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10072 PyObject *__pyx_r = NULL;
10073 __Pyx_RefNannyDeclarations
10074 PyObject *__pyx_t_1 = NULL;
10075 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10082 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 15, __pyx_L1_error)
10083 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
10084 __Pyx_GOTREF(__pyx_t_1);
10085 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10095 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10098 __Pyx_XDECREF(__pyx_t_1);
10099 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10102 __Pyx_XGIVEREF(__pyx_r);
10103 __Pyx_RefNannyFinishContext();
10115 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
10116 Py_intptr_t __pyx_v_aligned_p;
10117 size_t __pyx_v_offset;
10128 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10137 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10146 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10156 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10174 __pyx_r = ((
void *)__pyx_v_aligned_p);
10199 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10200 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10201 PyObject *__pyx_v_obj = 0;
10203 int __pyx_v_dtype_is_object;
10205 __Pyx_RefNannyDeclarations
10206 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
10208 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10209 PyObject* values[3] = {0,0,0};
10210 if (unlikely(__pyx_kwds)) {
10211 Py_ssize_t kw_args;
10212 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10213 switch (pos_args) {
10214 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10215 CYTHON_FALLTHROUGH;
10216 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10217 CYTHON_FALLTHROUGH;
10218 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10219 CYTHON_FALLTHROUGH;
10221 default:
goto __pyx_L5_argtuple_error;
10223 kw_args = PyDict_Size(__pyx_kwds);
10224 switch (pos_args) {
10226 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10227 else goto __pyx_L5_argtuple_error;
10228 CYTHON_FALLTHROUGH;
10230 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10232 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 344, __pyx_L3_error)
10234 CYTHON_FALLTHROUGH;
10237 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10238 if (value) { values[2] = value; kw_args--; }
10241 if (unlikely(kw_args > 0)) {
10242 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 344, __pyx_L3_error)
10245 switch (PyTuple_GET_SIZE(__pyx_args)) {
10246 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10247 CYTHON_FALLTHROUGH;
10248 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10249 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10251 default:
goto __pyx_L5_argtuple_error;
10254 __pyx_v_obj = values[0];
10255 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L3_error)
10257 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L3_error)
10259 __pyx_v_dtype_is_object = ((int)0);
10262 goto __pyx_L4_argument_unpacking_done;
10263 __pyx_L5_argtuple_error:;
10264 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 344, __pyx_L3_error)
10266 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10267 __Pyx_RefNannyFinishContext();
10269 __pyx_L4_argument_unpacking_done:;
10270 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10273 __Pyx_RefNannyFinishContext();
10277 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
10279 __Pyx_RefNannyDeclarations
10284 __Pyx_RefNannySetupContext(
"__cinit__", 0);
10293 __Pyx_INCREF(__pyx_v_obj);
10294 __Pyx_GIVEREF(__pyx_v_obj);
10295 __Pyx_GOTREF(__pyx_v_self->obj);
10296 __Pyx_DECREF(__pyx_v_self->obj);
10297 __pyx_v_self->obj = __pyx_v_obj;
10306 __pyx_v_self->flags = __pyx_v_flags;
10315 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10316 __pyx_t_3 = (__pyx_t_2 != 0);
10319 __pyx_t_1 = __pyx_t_3;
10320 goto __pyx_L4_bool_binop_done;
10322 __pyx_t_3 = (__pyx_v_obj != Py_None);
10323 __pyx_t_2 = (__pyx_t_3 != 0);
10324 __pyx_t_1 = __pyx_t_2;
10325 __pyx_L4_bool_binop_done:;
10335 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(0, 348, __pyx_L1_error)
10344 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10354 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10363 Py_INCREF(Py_None);
10390 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10400 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10409 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10427 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10437 __pyx_v_self->lock = PyThread_allocate_lock();
10446 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10447 if (unlikely(__pyx_t_1)) {
10456 PyErr_NoMemory(); __PYX_ERR(0, 360, __pyx_L1_error)
10483 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10493 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
10496 __pyx_t_1 = __pyx_t_2;
10497 goto __pyx_L11_bool_binop_done;
10499 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
10500 __pyx_t_1 = __pyx_t_2;
10501 __pyx_L11_bool_binop_done:;
10502 __pyx_v_self->dtype_is_object = __pyx_t_1;
10522 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10533 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
10542 __pyx_v_self->typeinfo = NULL;
10556 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10559 __Pyx_RefNannyFinishContext();
10572 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
10573 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10574 __Pyx_RefNannyDeclarations
10575 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
10576 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10579 __Pyx_RefNannyFinishContext();
10582 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10584 __Pyx_RefNannyDeclarations
10590 PyThread_type_lock __pyx_t_6;
10591 PyThread_type_lock __pyx_t_7;
10592 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
10601 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10602 __pyx_t_2 = (__pyx_t_1 != 0);
10612 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10630 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10640 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10641 __pyx_t_4 = __pyx_t_3;
10642 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10643 __pyx_v_i = __pyx_t_5;
10652 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10662 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10671 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10681 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10682 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10691 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10692 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10710 goto __pyx_L6_break;
10730 PyThread_free_lock(__pyx_v_self->lock);
10752 __Pyx_RefNannyFinishContext();
10763 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10764 Py_ssize_t __pyx_v_dim;
10765 char *__pyx_v_itemp;
10766 PyObject *__pyx_v_idx = NULL;
10768 __Pyx_RefNannyDeclarations
10769 Py_ssize_t __pyx_t_1;
10770 PyObject *__pyx_t_2 = NULL;
10771 Py_ssize_t __pyx_t_3;
10772 PyObject *(*__pyx_t_4)(PyObject *);
10773 PyObject *__pyx_t_5 = NULL;
10774 Py_ssize_t __pyx_t_6;
10776 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
10785 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
10795 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10796 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10799 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
10800 __Pyx_GOTREF(__pyx_t_2);
10801 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error)
10804 if (likely(!__pyx_t_4)) {
10805 if (likely(PyList_CheckExact(__pyx_t_2))) {
10806 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
10807 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 10808 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 392, __pyx_L1_error)
10810 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error)
10811 __Pyx_GOTREF(__pyx_t_5);
10814 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
10815 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 10816 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 392, __pyx_L1_error)
10818 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error)
10819 __Pyx_GOTREF(__pyx_t_5);
10823 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10824 if (unlikely(!__pyx_t_5)) {
10825 PyObject* exc_type = PyErr_Occurred();
10827 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10828 else __PYX_ERR(0, 392, __pyx_L1_error)
10832 __Pyx_GOTREF(__pyx_t_5);
10834 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10836 __pyx_v_dim = __pyx_t_1;
10837 __pyx_t_1 = (__pyx_t_1 + 1);
10846 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L1_error)
10847 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(0, 393, __pyx_L1_error)
10848 __pyx_v_itemp = __pyx_t_7;
10858 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10867 __pyx_r = __pyx_v_itemp;
10880 __Pyx_XDECREF(__pyx_t_2);
10881 __Pyx_XDECREF(__pyx_t_5);
10882 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10885 __Pyx_XDECREF(__pyx_v_idx);
10886 __Pyx_RefNannyFinishContext();
10899 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
10900 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10901 PyObject *__pyx_r = 0;
10902 __Pyx_RefNannyDeclarations
10903 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
10904 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10907 __Pyx_RefNannyFinishContext();
10911 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10912 PyObject *__pyx_v_have_slices = NULL;
10913 PyObject *__pyx_v_indices = NULL;
10914 char *__pyx_v_itemp;
10915 PyObject *__pyx_r = NULL;
10916 __Pyx_RefNannyDeclarations
10919 PyObject *__pyx_t_3 = NULL;
10920 PyObject *__pyx_t_4 = NULL;
10921 PyObject *__pyx_t_5 = NULL;
10923 __Pyx_RefNannySetupContext(
"__getitem__", 0);
10932 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10933 __pyx_t_2 = (__pyx_t_1 != 0);
10943 __Pyx_XDECREF(__pyx_r);
10944 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10945 __pyx_r = ((PyObject *)__pyx_v_self);
10964 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error)
10965 __Pyx_GOTREF(__pyx_t_3);
10966 if (likely(__pyx_t_3 != Py_None)) {
10967 PyObject* sequence = __pyx_t_3;
10968 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10969 if (unlikely(size != 2)) {
10970 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10971 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10972 __PYX_ERR(0, 402, __pyx_L1_error)
10974 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 10975 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10976 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10977 __Pyx_INCREF(__pyx_t_4);
10978 __Pyx_INCREF(__pyx_t_5);
10980 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
10981 __Pyx_GOTREF(__pyx_t_4);
10982 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
10983 __Pyx_GOTREF(__pyx_t_5);
10985 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10987 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 402, __pyx_L1_error)
10989 __pyx_v_have_slices = __pyx_t_4;
10991 __pyx_v_indices = __pyx_t_5;
11001 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
11011 __Pyx_XDECREF(__pyx_r);
11012 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error)
11013 __Pyx_GOTREF(__pyx_t_3);
11014 __pyx_r = __pyx_t_3;
11035 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(0, 408, __pyx_L1_error)
11036 __pyx_v_itemp = __pyx_t_6;
11045 __Pyx_XDECREF(__pyx_r);
11046 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
11047 __Pyx_GOTREF(__pyx_t_3);
11048 __pyx_r = __pyx_t_3;
11063 __Pyx_XDECREF(__pyx_t_3);
11064 __Pyx_XDECREF(__pyx_t_4);
11065 __Pyx_XDECREF(__pyx_t_5);
11066 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11069 __Pyx_XDECREF(__pyx_v_have_slices);
11070 __Pyx_XDECREF(__pyx_v_indices);
11071 __Pyx_XGIVEREF(__pyx_r);
11072 __Pyx_RefNannyFinishContext();
11085 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
11086 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11088 __Pyx_RefNannyDeclarations
11089 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
11090 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11093 __Pyx_RefNannyFinishContext();
11097 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11098 PyObject *__pyx_v_have_slices = NULL;
11099 PyObject *__pyx_v_obj = NULL;
11101 __Pyx_RefNannyDeclarations
11103 PyObject *__pyx_t_2 = NULL;
11104 PyObject *__pyx_t_3 = NULL;
11105 PyObject *__pyx_t_4 = NULL;
11106 __Pyx_RefNannySetupContext(
"__setitem__", 0);
11107 __Pyx_INCREF(__pyx_v_index);
11116 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11117 if (unlikely(__pyx_t_1)) {
11126 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
11127 __Pyx_GOTREF(__pyx_t_2);
11128 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11129 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11130 __PYX_ERR(0, 413, __pyx_L1_error)
11148 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error)
11149 __Pyx_GOTREF(__pyx_t_2);
11150 if (likely(__pyx_t_2 != Py_None)) {
11151 PyObject* sequence = __pyx_t_2;
11152 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11153 if (unlikely(size != 2)) {
11154 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11155 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11156 __PYX_ERR(0, 415, __pyx_L1_error)
11158 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 11159 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11160 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11161 __Pyx_INCREF(__pyx_t_3);
11162 __Pyx_INCREF(__pyx_t_4);
11164 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
11165 __Pyx_GOTREF(__pyx_t_3);
11166 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error)
11167 __Pyx_GOTREF(__pyx_t_4);
11169 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11171 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 415, __pyx_L1_error)
11173 __pyx_v_have_slices = __pyx_t_3;
11175 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11185 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 417, __pyx_L1_error)
11195 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
11196 __Pyx_GOTREF(__pyx_t_2);
11197 __pyx_v_obj = __pyx_t_2;
11207 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 419, __pyx_L1_error)
11217 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
11218 __Pyx_GOTREF(__pyx_t_2);
11219 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
11220 __Pyx_GOTREF(__pyx_t_4);
11221 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11222 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11242 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
11243 __Pyx_GOTREF(__pyx_t_4);
11244 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(0, 422, __pyx_L1_error)
11245 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
11246 __Pyx_GOTREF(__pyx_t_2);
11247 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11248 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11270 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
11271 __Pyx_GOTREF(__pyx_t_2);
11272 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11288 __Pyx_XDECREF(__pyx_t_2);
11289 __Pyx_XDECREF(__pyx_t_3);
11290 __Pyx_XDECREF(__pyx_t_4);
11291 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11294 __Pyx_XDECREF(__pyx_v_have_slices);
11295 __Pyx_XDECREF(__pyx_v_obj);
11296 __Pyx_XDECREF(__pyx_v_index);
11297 __Pyx_RefNannyFinishContext();
11309 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11310 PyObject *__pyx_r = NULL;
11311 __Pyx_RefNannyDeclarations
11314 PyObject *__pyx_t_3 = NULL;
11315 PyObject *__pyx_t_4 = NULL;
11316 PyObject *__pyx_t_5 = NULL;
11317 PyObject *__pyx_t_6 = NULL;
11318 PyObject *__pyx_t_7 = NULL;
11319 PyObject *__pyx_t_8 = NULL;
11321 __Pyx_RefNannySetupContext(
"is_slice", 0);
11322 __Pyx_INCREF(__pyx_v_obj);
11331 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11332 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11343 __Pyx_PyThreadState_declare
11344 __Pyx_PyThreadState_assign
11345 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11346 __Pyx_XGOTREF(__pyx_t_3);
11347 __Pyx_XGOTREF(__pyx_t_4);
11348 __Pyx_XGOTREF(__pyx_t_5);
11358 __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L4_error)
11359 __Pyx_GOTREF(__pyx_t_6);
11368 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L4_error)
11369 __Pyx_GOTREF(__pyx_t_7);
11378 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L4_error)
11379 __Pyx_GOTREF(__pyx_t_8);
11380 __Pyx_INCREF(__pyx_v_obj);
11381 __Pyx_GIVEREF(__pyx_v_obj);
11382 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11383 __Pyx_GIVEREF(__pyx_t_6);
11384 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11385 __Pyx_GIVEREF(__pyx_t_7);
11386 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11389 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L4_error)
11390 __Pyx_GOTREF(__pyx_t_7);
11391 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11392 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11403 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11404 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11405 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11406 goto __pyx_L9_try_end;
11408 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11409 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11410 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11419 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11421 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11422 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 431, __pyx_L6_except_error)
11423 __Pyx_GOTREF(__pyx_t_7);
11424 __Pyx_GOTREF(__pyx_t_8);
11425 __Pyx_GOTREF(__pyx_t_6);
11434 __Pyx_XDECREF(__pyx_r);
11435 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11436 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11437 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11438 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11439 goto __pyx_L7_except_return;
11441 goto __pyx_L6_except_error;
11442 __pyx_L6_except_error:;
11451 __Pyx_XGIVEREF(__pyx_t_3);
11452 __Pyx_XGIVEREF(__pyx_t_4);
11453 __Pyx_XGIVEREF(__pyx_t_5);
11454 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11455 goto __pyx_L1_error;
11456 __pyx_L7_except_return:;
11457 __Pyx_XGIVEREF(__pyx_t_3);
11458 __Pyx_XGIVEREF(__pyx_t_4);
11459 __Pyx_XGIVEREF(__pyx_t_5);
11460 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11481 __Pyx_XDECREF(__pyx_r);
11482 __Pyx_INCREF(__pyx_v_obj);
11483 __pyx_r = __pyx_v_obj;
11496 __Pyx_XDECREF(__pyx_t_6);
11497 __Pyx_XDECREF(__pyx_t_7);
11498 __Pyx_XDECREF(__pyx_t_8);
11499 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11502 __Pyx_XDECREF(__pyx_v_obj);
11503 __Pyx_XGIVEREF(__pyx_r);
11504 __Pyx_RefNannyFinishContext();
11516 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11517 __Pyx_memviewslice __pyx_v_dst_slice;
11518 __Pyx_memviewslice __pyx_v_src_slice;
11519 PyObject *__pyx_r = NULL;
11520 __Pyx_RefNannyDeclarations
11521 PyObject *__pyx_t_1 = NULL;
11525 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
11534 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(0, 440, __pyx_L1_error)
11543 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(0, 441, __pyx_L1_error)
11552 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
11553 __Pyx_GOTREF(__pyx_t_1);
11554 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L1_error)
11555 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11556 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
11557 __Pyx_GOTREF(__pyx_t_1);
11558 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L1_error)
11559 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11568 __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(0, 440, __pyx_L1_error)
11579 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11582 __Pyx_XDECREF(__pyx_t_1);
11583 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11586 __Pyx_XGIVEREF(__pyx_r);
11587 __Pyx_RefNannyFinishContext();
11599 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11600 int __pyx_v_array[0x80];
11602 void *__pyx_v_item;
11603 __Pyx_memviewslice *__pyx_v_dst_slice;
11604 __Pyx_memviewslice __pyx_v_tmp_slice;
11605 PyObject *__pyx_r = NULL;
11606 __Pyx_RefNannyDeclarations
11608 PyObject *__pyx_t_2 = NULL;
11611 char const *__pyx_t_5;
11612 PyObject *__pyx_t_6 = NULL;
11613 PyObject *__pyx_t_7 = NULL;
11614 PyObject *__pyx_t_8 = NULL;
11615 PyObject *__pyx_t_9 = NULL;
11616 PyObject *__pyx_t_10 = NULL;
11617 PyObject *__pyx_t_11 = NULL;
11618 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
11627 __pyx_v_tmp = NULL;
11636 __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
11645 __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
11655 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11664 __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
11665 if (unlikely(__pyx_t_1)) {
11674 PyErr_NoMemory(); __PYX_ERR(0, 456, __pyx_L1_error)
11692 __pyx_v_item = __pyx_v_tmp;
11712 __pyx_v_item = ((
void *)__pyx_v_array);
11732 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
11742 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11762 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L6_error)
11763 __Pyx_GOTREF(__pyx_t_2);
11764 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11775 __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11785 __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L6_error)
11786 __Pyx_GOTREF(__pyx_t_2);
11787 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11805 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11817 PyMem_Free(__pyx_v_tmp);
11822 __Pyx_PyThreadState_declare
11823 __Pyx_PyThreadState_assign
11824 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
11825 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11826 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
11827 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
11828 __Pyx_XGOTREF(__pyx_t_6);
11829 __Pyx_XGOTREF(__pyx_t_7);
11830 __Pyx_XGOTREF(__pyx_t_8);
11831 __Pyx_XGOTREF(__pyx_t_9);
11832 __Pyx_XGOTREF(__pyx_t_10);
11833 __Pyx_XGOTREF(__pyx_t_11);
11834 __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
11836 PyMem_Free(__pyx_v_tmp);
11838 if (PY_MAJOR_VERSION >= 3) {
11839 __Pyx_XGIVEREF(__pyx_t_9);
11840 __Pyx_XGIVEREF(__pyx_t_10);
11841 __Pyx_XGIVEREF(__pyx_t_11);
11842 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
11844 __Pyx_XGIVEREF(__pyx_t_6);
11845 __Pyx_XGIVEREF(__pyx_t_7);
11846 __Pyx_XGIVEREF(__pyx_t_8);
11847 __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
11848 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
11849 __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
11850 goto __pyx_L1_error;
11864 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11867 __Pyx_XDECREF(__pyx_t_2);
11868 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11871 __Pyx_XGIVEREF(__pyx_r);
11872 __Pyx_RefNannyFinishContext();
11884 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11885 char *__pyx_v_itemp;
11886 PyObject *__pyx_r = NULL;
11887 __Pyx_RefNannyDeclarations
11889 PyObject *__pyx_t_2 = NULL;
11890 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
11899 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(0, 477, __pyx_L1_error)
11900 __pyx_v_itemp = __pyx_t_1;
11909 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
11910 __Pyx_GOTREF(__pyx_t_2);
11911 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11922 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11925 __Pyx_XDECREF(__pyx_t_2);
11926 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11929 __Pyx_XGIVEREF(__pyx_r);
11930 __Pyx_RefNannyFinishContext();
11942 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
11943 PyObject *__pyx_v_struct = NULL;
11944 PyObject *__pyx_v_bytesitem = 0;
11945 PyObject *__pyx_v_result = NULL;
11946 PyObject *__pyx_r = NULL;
11947 __Pyx_RefNannyDeclarations
11948 PyObject *__pyx_t_1 = NULL;
11949 PyObject *__pyx_t_2 = NULL;
11950 PyObject *__pyx_t_3 = NULL;
11951 PyObject *__pyx_t_4 = NULL;
11952 PyObject *__pyx_t_5 = NULL;
11953 PyObject *__pyx_t_6 = NULL;
11954 PyObject *__pyx_t_7 = NULL;
11956 PyObject *__pyx_t_9 = NULL;
11959 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
11968 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
11969 __Pyx_GOTREF(__pyx_t_1);
11970 __pyx_v_struct = __pyx_t_1;
11980 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
11981 __Pyx_GOTREF(__pyx_t_1);
11982 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11993 __Pyx_PyThreadState_declare
11994 __Pyx_PyThreadState_assign
11995 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11996 __Pyx_XGOTREF(__pyx_t_2);
11997 __Pyx_XGOTREF(__pyx_t_3);
11998 __Pyx_XGOTREF(__pyx_t_4);
12008 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L3_error)
12009 __Pyx_GOTREF(__pyx_t_5);
12010 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 488, __pyx_L3_error)
12011 __Pyx_GOTREF(__pyx_t_6);
12014 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12015 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12016 if (likely(__pyx_t_7)) {
12017 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12018 __Pyx_INCREF(__pyx_t_7);
12019 __Pyx_INCREF(
function);
12020 __Pyx_DECREF_SET(__pyx_t_5,
function);
12024 #if CYTHON_FAST_PYCALL 12025 if (PyFunction_Check(__pyx_t_5)) {
12026 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12027 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L3_error)
12028 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12029 __Pyx_GOTREF(__pyx_t_1);
12030 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12033 #if CYTHON_FAST_PYCCALL 12034 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12035 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12036 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L3_error)
12037 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12038 __Pyx_GOTREF(__pyx_t_1);
12039 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12043 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 488, __pyx_L3_error)
12044 __Pyx_GOTREF(__pyx_t_9);
12046 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12048 __Pyx_GIVEREF(__pyx_t_6);
12049 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12050 __Pyx_INCREF(__pyx_v_bytesitem);
12051 __Pyx_GIVEREF(__pyx_v_bytesitem);
12052 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12054 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L3_error)
12055 __Pyx_GOTREF(__pyx_t_1);
12056 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12058 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12059 __pyx_v_result = __pyx_t_1;
12079 __pyx_t_10 = strlen(__pyx_v_self->view.format);
12080 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12090 __Pyx_XDECREF(__pyx_r);
12091 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L5_except_error)
12092 __Pyx_GOTREF(__pyx_t_1);
12093 __pyx_r = __pyx_t_1;
12095 goto __pyx_L6_except_return;
12113 __Pyx_XDECREF(__pyx_r);
12114 __Pyx_INCREF(__pyx_v_result);
12115 __pyx_r = __pyx_v_result;
12116 goto __pyx_L6_except_return;
12119 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12120 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12121 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12122 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12123 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12132 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12133 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 489, __pyx_L5_except_error)
12134 __Pyx_GOTREF(__pyx_t_6);
12135 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12136 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12137 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12138 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12140 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12141 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 489, __pyx_L5_except_error)
12142 __Pyx_GOTREF(__pyx_t_9);
12143 __Pyx_GOTREF(__pyx_t_5);
12144 __Pyx_GOTREF(__pyx_t_1);
12153 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 490, __pyx_L5_except_error)
12154 __Pyx_GOTREF(__pyx_t_6);
12155 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12156 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12157 __PYX_ERR(0, 490, __pyx_L5_except_error)
12159 goto __pyx_L5_except_error;
12160 __pyx_L5_except_error:;
12169 __Pyx_XGIVEREF(__pyx_t_2);
12170 __Pyx_XGIVEREF(__pyx_t_3);
12171 __Pyx_XGIVEREF(__pyx_t_4);
12172 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12173 goto __pyx_L1_error;
12174 __pyx_L6_except_return:;
12175 __Pyx_XGIVEREF(__pyx_t_2);
12176 __Pyx_XGIVEREF(__pyx_t_3);
12177 __Pyx_XGIVEREF(__pyx_t_4);
12178 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12192 __Pyx_XDECREF(__pyx_t_1);
12193 __Pyx_XDECREF(__pyx_t_5);
12194 __Pyx_XDECREF(__pyx_t_6);
12195 __Pyx_XDECREF(__pyx_t_7);
12196 __Pyx_XDECREF(__pyx_t_9);
12197 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12200 __Pyx_XDECREF(__pyx_v_struct);
12201 __Pyx_XDECREF(__pyx_v_bytesitem);
12202 __Pyx_XDECREF(__pyx_v_result);
12203 __Pyx_XGIVEREF(__pyx_r);
12204 __Pyx_RefNannyFinishContext();
12216 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12217 PyObject *__pyx_v_struct = NULL;
12219 PyObject *__pyx_v_bytesvalue = 0;
12220 Py_ssize_t __pyx_v_i;
12221 PyObject *__pyx_r = NULL;
12222 __Pyx_RefNannyDeclarations
12223 PyObject *__pyx_t_1 = NULL;
12226 PyObject *__pyx_t_4 = NULL;
12227 PyObject *__pyx_t_5 = NULL;
12228 PyObject *__pyx_t_6 = NULL;
12230 PyObject *__pyx_t_8 = NULL;
12231 Py_ssize_t __pyx_t_9;
12232 PyObject *__pyx_t_10 = NULL;
12237 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
12246 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
12247 __Pyx_GOTREF(__pyx_t_1);
12248 __pyx_v_struct = __pyx_t_1;
12258 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12259 __pyx_t_3 = (__pyx_t_2 != 0);
12269 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
12270 __Pyx_GOTREF(__pyx_t_1);
12271 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
12272 __Pyx_GOTREF(__pyx_t_4);
12273 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
12274 __Pyx_GOTREF(__pyx_t_5);
12275 __Pyx_GIVEREF(__pyx_t_4);
12276 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12278 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
12279 __Pyx_GOTREF(__pyx_t_4);
12280 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error)
12281 __Pyx_GOTREF(__pyx_t_6);
12282 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12283 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12284 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
12285 __Pyx_GOTREF(__pyx_t_4);
12286 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12287 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12288 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 505, __pyx_L1_error)
12289 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12310 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error)
12311 __Pyx_GOTREF(__pyx_t_6);
12312 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
12313 __Pyx_GOTREF(__pyx_t_1);
12316 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12317 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12318 if (likely(__pyx_t_5)) {
12319 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12320 __Pyx_INCREF(__pyx_t_5);
12321 __Pyx_INCREF(
function);
12322 __Pyx_DECREF_SET(__pyx_t_6,
function);
12326 #if CYTHON_FAST_PYCALL 12327 if (PyFunction_Check(__pyx_t_6)) {
12328 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12329 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
12330 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12331 __Pyx_GOTREF(__pyx_t_4);
12332 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12335 #if CYTHON_FAST_PYCCALL 12336 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12337 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12338 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
12339 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12340 __Pyx_GOTREF(__pyx_t_4);
12341 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12345 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 507, __pyx_L1_error)
12346 __Pyx_GOTREF(__pyx_t_8);
12348 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12350 __Pyx_GIVEREF(__pyx_t_1);
12351 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12352 __Pyx_INCREF(__pyx_v_value);
12353 __Pyx_GIVEREF(__pyx_v_value);
12354 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12356 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
12357 __Pyx_GOTREF(__pyx_t_4);
12358 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12360 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12361 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 507, __pyx_L1_error)
12362 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12375 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12376 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
12377 __PYX_ERR(0, 509, __pyx_L1_error)
12379 __Pyx_INCREF(__pyx_v_bytesvalue);
12380 __pyx_t_10 = __pyx_v_bytesvalue;
12381 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12382 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12383 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12384 __pyx_t_11 = __pyx_t_14;
12385 __pyx_v_c = (__pyx_t_11[0]);
12394 __pyx_v_i = __pyx_t_9;
12403 __pyx_t_9 = (__pyx_t_9 + 1);
12412 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12414 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12425 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12428 __Pyx_XDECREF(__pyx_t_1);
12429 __Pyx_XDECREF(__pyx_t_4);
12430 __Pyx_XDECREF(__pyx_t_5);
12431 __Pyx_XDECREF(__pyx_t_6);
12432 __Pyx_XDECREF(__pyx_t_8);
12433 __Pyx_XDECREF(__pyx_t_10);
12434 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12437 __Pyx_XDECREF(__pyx_v_struct);
12438 __Pyx_XDECREF(__pyx_v_bytesvalue);
12439 __Pyx_XGIVEREF(__pyx_r);
12440 __Pyx_RefNannyFinishContext();
12453 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
12454 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12456 __Pyx_RefNannyDeclarations
12457 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
12458 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
12461 __Pyx_RefNannyFinishContext();
12465 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12467 __Pyx_RefNannyDeclarations
12470 PyObject *__pyx_t_3 = NULL;
12471 Py_ssize_t *__pyx_t_4;
12475 Py_ssize_t __pyx_t_8;
12476 if (__pyx_v_info == NULL) {
12477 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
12480 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
12481 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12482 __Pyx_GIVEREF(__pyx_v_info->obj);
12491 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12494 __pyx_t_1 = __pyx_t_2;
12495 goto __pyx_L4_bool_binop_done;
12497 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12498 __pyx_t_1 = __pyx_t_2;
12499 __pyx_L4_bool_binop_done:;
12500 if (unlikely(__pyx_t_1)) {
12509 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
12510 __Pyx_GOTREF(__pyx_t_3);
12511 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12512 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12513 __PYX_ERR(0, 515, __pyx_L1_error)
12531 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12541 __pyx_t_4 = __pyx_v_self->view.shape;
12542 __pyx_v_info->shape = __pyx_t_4;
12562 __pyx_v_info->shape = NULL;
12573 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12583 __pyx_t_4 = __pyx_v_self->view.strides;
12584 __pyx_v_info->strides = __pyx_t_4;
12604 __pyx_v_info->strides = NULL;
12615 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12625 __pyx_t_4 = __pyx_v_self->view.suboffsets;
12626 __pyx_v_info->suboffsets = __pyx_t_4;
12646 __pyx_v_info->suboffsets = NULL;
12657 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12667 __pyx_t_5 = __pyx_v_self->view.format;
12668 __pyx_v_info->format = __pyx_t_5;
12688 __pyx_v_info->format = NULL;
12699 __pyx_t_6 = __pyx_v_self->view.buf;
12700 __pyx_v_info->buf = __pyx_t_6;
12709 __pyx_t_7 = __pyx_v_self->view.ndim;
12710 __pyx_v_info->ndim = __pyx_t_7;
12719 __pyx_t_8 = __pyx_v_self->view.itemsize;
12720 __pyx_v_info->itemsize = __pyx_t_8;
12729 __pyx_t_8 = __pyx_v_self->view.len;
12730 __pyx_v_info->len = __pyx_t_8;
12739 __pyx_t_1 = __pyx_v_self->view.readonly;
12740 __pyx_v_info->readonly = __pyx_t_1;
12749 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12750 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12751 __Pyx_GOTREF(__pyx_v_info->obj);
12752 __Pyx_DECREF(__pyx_v_info->obj);
12753 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12767 __Pyx_XDECREF(__pyx_t_3);
12768 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12770 if (__pyx_v_info->obj != NULL) {
12771 __Pyx_GOTREF(__pyx_v_info->obj);
12772 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12776 if (__pyx_v_info->obj == Py_None) {
12777 __Pyx_GOTREF(__pyx_v_info->obj);
12778 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12781 __Pyx_RefNannyFinishContext();
12794 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
12795 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12796 PyObject *__pyx_r = 0;
12797 __Pyx_RefNannyDeclarations
12798 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12799 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12802 __Pyx_RefNannyFinishContext();
12806 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12807 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12808 PyObject *__pyx_r = NULL;
12809 __Pyx_RefNannyDeclarations
12810 PyObject *__pyx_t_1 = NULL;
12812 __Pyx_RefNannySetupContext(
"__get__", 0);
12821 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
12822 __Pyx_GOTREF(__pyx_t_1);
12823 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(0, 549, __pyx_L1_error)
12824 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12834 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(0, 550, __pyx_L1_error)
12843 __Pyx_XDECREF(__pyx_r);
12844 __Pyx_INCREF(((PyObject *)__pyx_v_result));
12845 __pyx_r = ((PyObject *)__pyx_v_result);
12858 __Pyx_XDECREF(__pyx_t_1);
12859 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12862 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12863 __Pyx_XGIVEREF(__pyx_r);
12864 __Pyx_RefNannyFinishContext();
12877 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
12878 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12879 PyObject *__pyx_r = 0;
12880 __Pyx_RefNannyDeclarations
12881 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12882 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12885 __Pyx_RefNannyFinishContext();
12889 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12890 PyObject *__pyx_r = NULL;
12891 __Pyx_RefNannyDeclarations
12892 __Pyx_RefNannySetupContext(
"__get__", 0);
12901 __Pyx_XDECREF(__pyx_r);
12902 __Pyx_INCREF(__pyx_v_self->obj);
12903 __pyx_r = __pyx_v_self->obj;
12916 __Pyx_XGIVEREF(__pyx_r);
12917 __Pyx_RefNannyFinishContext();
12930 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
12931 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12932 PyObject *__pyx_r = 0;
12933 __Pyx_RefNannyDeclarations
12934 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12935 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12938 __Pyx_RefNannyFinishContext();
12942 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12943 Py_ssize_t __pyx_v_length;
12944 PyObject *__pyx_r = NULL;
12945 __Pyx_RefNannyDeclarations
12946 PyObject *__pyx_t_1 = NULL;
12947 Py_ssize_t *__pyx_t_2;
12948 Py_ssize_t *__pyx_t_3;
12949 Py_ssize_t *__pyx_t_4;
12950 PyObject *__pyx_t_5 = NULL;
12951 __Pyx_RefNannySetupContext(
"__get__", 0);
12960 __Pyx_XDECREF(__pyx_r);
12961 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
12962 __Pyx_GOTREF(__pyx_t_1);
12963 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12964 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12965 __pyx_t_2 = __pyx_t_4;
12966 __pyx_v_length = (__pyx_t_2[0]);
12967 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
12968 __Pyx_GOTREF(__pyx_t_5);
12969 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 559, __pyx_L1_error)
12970 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12972 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
12973 __Pyx_GOTREF(__pyx_t_5);
12974 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12975 __pyx_r = __pyx_t_5;
12989 __Pyx_XDECREF(__pyx_t_1);
12990 __Pyx_XDECREF(__pyx_t_5);
12991 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12994 __Pyx_XGIVEREF(__pyx_r);
12995 __Pyx_RefNannyFinishContext();
13008 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
13009 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13010 PyObject *__pyx_r = 0;
13011 __Pyx_RefNannyDeclarations
13012 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13013 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13016 __Pyx_RefNannyFinishContext();
13020 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13021 Py_ssize_t __pyx_v_stride;
13022 PyObject *__pyx_r = NULL;
13023 __Pyx_RefNannyDeclarations
13025 PyObject *__pyx_t_2 = NULL;
13026 Py_ssize_t *__pyx_t_3;
13027 Py_ssize_t *__pyx_t_4;
13028 Py_ssize_t *__pyx_t_5;
13029 PyObject *__pyx_t_6 = NULL;
13030 __Pyx_RefNannySetupContext(
"__get__", 0);
13039 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13040 if (unlikely(__pyx_t_1)) {
13049 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error)
13050 __Pyx_GOTREF(__pyx_t_2);
13051 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13052 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13053 __PYX_ERR(0, 565, __pyx_L1_error)
13071 __Pyx_XDECREF(__pyx_r);
13072 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error)
13073 __Pyx_GOTREF(__pyx_t_2);
13074 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13075 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13076 __pyx_t_3 = __pyx_t_5;
13077 __pyx_v_stride = (__pyx_t_3[0]);
13078 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error)
13079 __Pyx_GOTREF(__pyx_t_6);
13080 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 567, __pyx_L1_error)
13081 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13083 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error)
13084 __Pyx_GOTREF(__pyx_t_6);
13085 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13086 __pyx_r = __pyx_t_6;
13100 __Pyx_XDECREF(__pyx_t_2);
13101 __Pyx_XDECREF(__pyx_t_6);
13102 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13105 __Pyx_XGIVEREF(__pyx_r);
13106 __Pyx_RefNannyFinishContext();
13119 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
13120 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13121 PyObject *__pyx_r = 0;
13122 __Pyx_RefNannyDeclarations
13123 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13124 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13127 __Pyx_RefNannyFinishContext();
13131 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13132 Py_ssize_t __pyx_v_suboffset;
13133 PyObject *__pyx_r = NULL;
13134 __Pyx_RefNannyDeclarations
13136 PyObject *__pyx_t_2 = NULL;
13137 PyObject *__pyx_t_3 = NULL;
13138 Py_ssize_t *__pyx_t_4;
13139 Py_ssize_t *__pyx_t_5;
13140 Py_ssize_t *__pyx_t_6;
13141 __Pyx_RefNannySetupContext(
"__get__", 0);
13150 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13160 __Pyx_XDECREF(__pyx_r);
13161 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
13162 __Pyx_GOTREF(__pyx_t_2);
13163 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__24, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
13164 __Pyx_GOTREF(__pyx_t_3);
13165 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13166 __pyx_r = __pyx_t_3;
13186 __Pyx_XDECREF(__pyx_r);
13187 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
13188 __Pyx_GOTREF(__pyx_t_3);
13189 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13190 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13191 __pyx_t_4 = __pyx_t_6;
13192 __pyx_v_suboffset = (__pyx_t_4[0]);
13193 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error)
13194 __Pyx_GOTREF(__pyx_t_2);
13195 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 574, __pyx_L1_error)
13196 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13198 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error)
13199 __Pyx_GOTREF(__pyx_t_2);
13200 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13201 __pyx_r = __pyx_t_2;
13215 __Pyx_XDECREF(__pyx_t_2);
13216 __Pyx_XDECREF(__pyx_t_3);
13217 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13220 __Pyx_XGIVEREF(__pyx_r);
13221 __Pyx_RefNannyFinishContext();
13234 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
13235 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13236 PyObject *__pyx_r = 0;
13237 __Pyx_RefNannyDeclarations
13238 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13239 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13242 __Pyx_RefNannyFinishContext();
13246 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13247 PyObject *__pyx_r = NULL;
13248 __Pyx_RefNannyDeclarations
13249 PyObject *__pyx_t_1 = NULL;
13250 __Pyx_RefNannySetupContext(
"__get__", 0);
13259 __Pyx_XDECREF(__pyx_r);
13260 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
13261 __Pyx_GOTREF(__pyx_t_1);
13262 __pyx_r = __pyx_t_1;
13276 __Pyx_XDECREF(__pyx_t_1);
13277 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13280 __Pyx_XGIVEREF(__pyx_r);
13281 __Pyx_RefNannyFinishContext();
13294 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
13295 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13296 PyObject *__pyx_r = 0;
13297 __Pyx_RefNannyDeclarations
13298 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13299 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13302 __Pyx_RefNannyFinishContext();
13306 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13307 PyObject *__pyx_r = NULL;
13308 __Pyx_RefNannyDeclarations
13309 PyObject *__pyx_t_1 = NULL;
13310 __Pyx_RefNannySetupContext(
"__get__", 0);
13319 __Pyx_XDECREF(__pyx_r);
13320 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
13321 __Pyx_GOTREF(__pyx_t_1);
13322 __pyx_r = __pyx_t_1;
13336 __Pyx_XDECREF(__pyx_t_1);
13337 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13340 __Pyx_XGIVEREF(__pyx_r);
13341 __Pyx_RefNannyFinishContext();
13354 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
13355 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13356 PyObject *__pyx_r = 0;
13357 __Pyx_RefNannyDeclarations
13358 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13359 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13362 __Pyx_RefNannyFinishContext();
13366 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13367 PyObject *__pyx_r = NULL;
13368 __Pyx_RefNannyDeclarations
13369 PyObject *__pyx_t_1 = NULL;
13370 PyObject *__pyx_t_2 = NULL;
13371 PyObject *__pyx_t_3 = NULL;
13372 __Pyx_RefNannySetupContext(
"__get__", 0);
13381 __Pyx_XDECREF(__pyx_r);
13382 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error)
13383 __Pyx_GOTREF(__pyx_t_1);
13384 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error)
13385 __Pyx_GOTREF(__pyx_t_2);
13386 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
13387 __Pyx_GOTREF(__pyx_t_3);
13388 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13389 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13390 __pyx_r = __pyx_t_3;
13404 __Pyx_XDECREF(__pyx_t_1);
13405 __Pyx_XDECREF(__pyx_t_2);
13406 __Pyx_XDECREF(__pyx_t_3);
13407 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13410 __Pyx_XGIVEREF(__pyx_r);
13411 __Pyx_RefNannyFinishContext();
13424 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
13425 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13426 PyObject *__pyx_r = 0;
13427 __Pyx_RefNannyDeclarations
13428 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13429 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13432 __Pyx_RefNannyFinishContext();
13436 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13437 PyObject *__pyx_v_result = NULL;
13438 PyObject *__pyx_v_length = NULL;
13439 PyObject *__pyx_r = NULL;
13440 __Pyx_RefNannyDeclarations
13443 Py_ssize_t *__pyx_t_3;
13444 Py_ssize_t *__pyx_t_4;
13445 Py_ssize_t *__pyx_t_5;
13446 PyObject *__pyx_t_6 = NULL;
13447 __Pyx_RefNannySetupContext(
"__get__", 0);
13456 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13457 __pyx_t_2 = (__pyx_t_1 != 0);
13467 __Pyx_INCREF(__pyx_int_1);
13468 __pyx_v_result = __pyx_int_1;
13477 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13478 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13479 __pyx_t_3 = __pyx_t_5;
13480 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 593, __pyx_L1_error)
13481 __Pyx_GOTREF(__pyx_t_6);
13482 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13492 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 594, __pyx_L1_error)
13493 __Pyx_GOTREF(__pyx_t_6);
13494 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13505 __Pyx_INCREF(__pyx_v_result);
13506 __Pyx_GIVEREF(__pyx_v_result);
13507 __Pyx_GOTREF(__pyx_v_self->_size);
13508 __Pyx_DECREF(__pyx_v_self->_size);
13509 __pyx_v_self->_size = __pyx_v_result;
13527 __Pyx_XDECREF(__pyx_r);
13528 __Pyx_INCREF(__pyx_v_self->_size);
13529 __pyx_r = __pyx_v_self->_size;
13542 __Pyx_XDECREF(__pyx_t_6);
13543 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13546 __Pyx_XDECREF(__pyx_v_result);
13547 __Pyx_XDECREF(__pyx_v_length);
13548 __Pyx_XGIVEREF(__pyx_r);
13549 __Pyx_RefNannyFinishContext();
13562 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
13563 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13564 Py_ssize_t __pyx_r;
13565 __Pyx_RefNannyDeclarations
13566 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
13567 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13570 __Pyx_RefNannyFinishContext();
13574 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13575 Py_ssize_t __pyx_r;
13576 __Pyx_RefNannyDeclarations
13578 __Pyx_RefNannySetupContext(
"__len__", 0);
13587 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13597 __pyx_r = (__pyx_v_self->view.shape[0]);
13629 __Pyx_RefNannyFinishContext();
13642 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
13643 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13644 PyObject *__pyx_r = 0;
13645 __Pyx_RefNannyDeclarations
13646 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
13647 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13650 __Pyx_RefNannyFinishContext();
13654 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13655 PyObject *__pyx_r = NULL;
13656 __Pyx_RefNannyDeclarations
13657 PyObject *__pyx_t_1 = NULL;
13658 PyObject *__pyx_t_2 = NULL;
13659 PyObject *__pyx_t_3 = NULL;
13660 __Pyx_RefNannySetupContext(
"__repr__", 0);
13669 __Pyx_XDECREF(__pyx_r);
13670 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
13671 __Pyx_GOTREF(__pyx_t_1);
13672 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
13673 __Pyx_GOTREF(__pyx_t_2);
13674 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13675 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
13676 __Pyx_GOTREF(__pyx_t_1);
13677 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13686 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
13687 __Pyx_GOTREF(__pyx_t_2);
13696 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error)
13697 __Pyx_GOTREF(__pyx_t_3);
13698 __Pyx_GIVEREF(__pyx_t_1);
13699 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13700 __Pyx_GIVEREF(__pyx_t_2);
13701 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13704 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
13705 __Pyx_GOTREF(__pyx_t_2);
13706 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13707 __pyx_r = __pyx_t_2;
13721 __Pyx_XDECREF(__pyx_t_1);
13722 __Pyx_XDECREF(__pyx_t_2);
13723 __Pyx_XDECREF(__pyx_t_3);
13724 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13727 __Pyx_XGIVEREF(__pyx_r);
13728 __Pyx_RefNannyFinishContext();
13741 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
13742 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13743 PyObject *__pyx_r = 0;
13744 __Pyx_RefNannyDeclarations
13745 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
13746 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13749 __Pyx_RefNannyFinishContext();
13753 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13754 PyObject *__pyx_r = NULL;
13755 __Pyx_RefNannyDeclarations
13756 PyObject *__pyx_t_1 = NULL;
13757 PyObject *__pyx_t_2 = NULL;
13758 __Pyx_RefNannySetupContext(
"__str__", 0);
13767 __Pyx_XDECREF(__pyx_r);
13768 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
13769 __Pyx_GOTREF(__pyx_t_1);
13770 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error)
13771 __Pyx_GOTREF(__pyx_t_2);
13772 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13773 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
13774 __Pyx_GOTREF(__pyx_t_1);
13775 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13776 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error)
13777 __Pyx_GOTREF(__pyx_t_2);
13778 __Pyx_GIVEREF(__pyx_t_1);
13779 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13781 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
13782 __Pyx_GOTREF(__pyx_t_1);
13783 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13784 __pyx_r = __pyx_t_1;
13798 __Pyx_XDECREF(__pyx_t_1);
13799 __Pyx_XDECREF(__pyx_t_2);
13800 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13803 __Pyx_XGIVEREF(__pyx_r);
13804 __Pyx_RefNannyFinishContext();
13817 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13818 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
13819 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13820 PyObject *__pyx_r = 0;
13821 __Pyx_RefNannyDeclarations
13822 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
13823 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13826 __Pyx_RefNannyFinishContext();
13830 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13831 __Pyx_memviewslice *__pyx_v_mslice;
13832 __Pyx_memviewslice __pyx_v_tmp;
13833 PyObject *__pyx_r = NULL;
13834 __Pyx_RefNannyDeclarations
13835 PyObject *__pyx_t_1 = NULL;
13836 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
13845 __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
13854 __Pyx_XDECREF(__pyx_r);
13855 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
13856 __Pyx_GOTREF(__pyx_t_1);
13857 __pyx_r = __pyx_t_1;
13871 __Pyx_XDECREF(__pyx_t_1);
13872 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13875 __Pyx_XGIVEREF(__pyx_r);
13876 __Pyx_RefNannyFinishContext();
13889 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13890 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
13891 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13892 PyObject *__pyx_r = 0;
13893 __Pyx_RefNannyDeclarations
13894 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
13895 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13898 __Pyx_RefNannyFinishContext();
13902 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13903 __Pyx_memviewslice *__pyx_v_mslice;
13904 __Pyx_memviewslice __pyx_v_tmp;
13905 PyObject *__pyx_r = NULL;
13906 __Pyx_RefNannyDeclarations
13907 PyObject *__pyx_t_1 = NULL;
13908 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
13917 __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
13926 __Pyx_XDECREF(__pyx_r);
13927 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13928 __Pyx_GOTREF(__pyx_t_1);
13929 __pyx_r = __pyx_t_1;
13943 __Pyx_XDECREF(__pyx_t_1);
13944 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13947 __Pyx_XGIVEREF(__pyx_r);
13948 __Pyx_RefNannyFinishContext();
13961 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13962 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
13963 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13964 PyObject *__pyx_r = 0;
13965 __Pyx_RefNannyDeclarations
13966 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
13967 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13970 __Pyx_RefNannyFinishContext();
13974 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
13975 __Pyx_memviewslice __pyx_v_mslice;
13977 PyObject *__pyx_r = NULL;
13978 __Pyx_RefNannyDeclarations
13979 __Pyx_memviewslice __pyx_t_1;
13980 PyObject *__pyx_t_2 = NULL;
13981 __Pyx_RefNannySetupContext(
"copy", 0);
13990 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13999 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14008 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 631, __pyx_L1_error)
14009 __pyx_v_mslice = __pyx_t_1;
14018 __Pyx_XDECREF(__pyx_r);
14019 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
14020 __Pyx_GOTREF(__pyx_t_2);
14021 __pyx_r = __pyx_t_2;
14035 __Pyx_XDECREF(__pyx_t_2);
14036 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14039 __Pyx_XGIVEREF(__pyx_r);
14040 __Pyx_RefNannyFinishContext();
14053 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14054 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
14055 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14056 PyObject *__pyx_r = 0;
14057 __Pyx_RefNannyDeclarations
14058 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
14059 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14062 __Pyx_RefNannyFinishContext();
14066 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
14067 __Pyx_memviewslice __pyx_v_src;
14068 __Pyx_memviewslice __pyx_v_dst;
14070 PyObject *__pyx_r = NULL;
14071 __Pyx_RefNannyDeclarations
14072 __Pyx_memviewslice __pyx_t_1;
14073 PyObject *__pyx_t_2 = NULL;
14074 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
14083 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14092 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14101 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L1_error)
14102 __pyx_v_dst = __pyx_t_1;
14111 __Pyx_XDECREF(__pyx_r);
14112 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
14113 __Pyx_GOTREF(__pyx_t_2);
14114 __pyx_r = __pyx_t_2;
14128 __Pyx_XDECREF(__pyx_t_2);
14129 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14132 __Pyx_XGIVEREF(__pyx_r);
14133 __Pyx_RefNannyFinishContext();
14144 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14145 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14146 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14147 PyObject *__pyx_r = 0;
14148 __Pyx_RefNannyDeclarations
14149 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
14150 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14153 __Pyx_RefNannyFinishContext();
14157 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
14158 PyObject *__pyx_r = NULL;
14159 __Pyx_RefNannyDeclarations
14160 PyObject *__pyx_t_1 = NULL;
14161 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
14169 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
14170 __Pyx_GOTREF(__pyx_t_1);
14171 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14172 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14173 __PYX_ERR(0, 2, __pyx_L1_error)
14183 __Pyx_XDECREF(__pyx_t_1);
14184 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14186 __Pyx_XGIVEREF(__pyx_r);
14187 __Pyx_RefNannyFinishContext();
14199 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
14200 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14201 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14202 PyObject *__pyx_r = 0;
14203 __Pyx_RefNannyDeclarations
14204 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
14205 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14208 __Pyx_RefNannyFinishContext();
14212 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14213 PyObject *__pyx_r = NULL;
14214 __Pyx_RefNannyDeclarations
14215 PyObject *__pyx_t_1 = NULL;
14216 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
14223 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
14224 __Pyx_GOTREF(__pyx_t_1);
14225 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14226 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14227 __PYX_ERR(0, 4, __pyx_L1_error)
14238 __Pyx_XDECREF(__pyx_t_1);
14239 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14241 __Pyx_XGIVEREF(__pyx_r);
14242 __Pyx_RefNannyFinishContext();
14254 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14255 struct __pyx_memoryview_obj *__pyx_v_result = 0;
14256 PyObject *__pyx_r = NULL;
14257 __Pyx_RefNannyDeclarations
14258 PyObject *__pyx_t_1 = NULL;
14259 PyObject *__pyx_t_2 = NULL;
14260 PyObject *__pyx_t_3 = NULL;
14261 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
14270 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error)
14271 __Pyx_GOTREF(__pyx_t_1);
14272 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error)
14273 __Pyx_GOTREF(__pyx_t_2);
14274 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error)
14275 __Pyx_GOTREF(__pyx_t_3);
14276 __Pyx_INCREF(__pyx_v_o);
14277 __Pyx_GIVEREF(__pyx_v_o);
14278 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14279 __Pyx_GIVEREF(__pyx_t_1);
14280 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14281 __Pyx_GIVEREF(__pyx_t_2);
14282 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14285 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error)
14286 __Pyx_GOTREF(__pyx_t_2);
14287 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14288 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14298 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14307 __Pyx_XDECREF(__pyx_r);
14308 __Pyx_INCREF(((PyObject *)__pyx_v_result));
14309 __pyx_r = ((PyObject *)__pyx_v_result);
14322 __Pyx_XDECREF(__pyx_t_1);
14323 __Pyx_XDECREF(__pyx_t_2);
14324 __Pyx_XDECREF(__pyx_t_3);
14325 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14328 __Pyx_XDECREF((PyObject *)__pyx_v_result);
14329 __Pyx_XGIVEREF(__pyx_r);
14330 __Pyx_RefNannyFinishContext();
14342 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14344 __Pyx_RefNannyDeclarations
14346 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
14355 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14356 __pyx_r = __pyx_t_1;
14369 __Pyx_RefNannyFinishContext();
14381 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
14382 PyObject *__pyx_v_tup = NULL;
14383 PyObject *__pyx_v_result = NULL;
14384 int __pyx_v_have_slices;
14385 int __pyx_v_seen_ellipsis;
14386 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14387 PyObject *__pyx_v_item = NULL;
14388 Py_ssize_t __pyx_v_nslices;
14389 PyObject *__pyx_r = NULL;
14390 __Pyx_RefNannyDeclarations
14393 PyObject *__pyx_t_3 = NULL;
14394 PyObject *__pyx_t_4 = NULL;
14395 Py_ssize_t __pyx_t_5;
14396 PyObject *(*__pyx_t_6)(PyObject *);
14397 PyObject *__pyx_t_7 = NULL;
14398 Py_ssize_t __pyx_t_8;
14401 PyObject *__pyx_t_11 = NULL;
14402 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
14411 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14412 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14422 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
14423 __Pyx_GOTREF(__pyx_t_3);
14424 __Pyx_INCREF(__pyx_v_index);
14425 __Pyx_GIVEREF(__pyx_v_index);
14426 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14427 __pyx_v_tup = __pyx_t_3;
14448 __Pyx_INCREF(__pyx_v_index);
14449 __pyx_v_tup = __pyx_v_index;
14460 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error)
14461 __Pyx_GOTREF(__pyx_t_3);
14462 __pyx_v_result = ((PyObject*)__pyx_t_3);
14472 __pyx_v_have_slices = 0;
14481 __pyx_v_seen_ellipsis = 0;
14490 __Pyx_INCREF(__pyx_int_0);
14491 __pyx_t_3 = __pyx_int_0;
14492 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14493 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14496 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error)
14497 __Pyx_GOTREF(__pyx_t_4);
14498 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 674, __pyx_L1_error)
14501 if (likely(!__pyx_t_6)) {
14502 if (likely(PyList_CheckExact(__pyx_t_4))) {
14503 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
14504 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 14505 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(0, 674, __pyx_L1_error)
14507 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L1_error)
14508 __Pyx_GOTREF(__pyx_t_7);
14511 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
14512 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 14513 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(0, 674, __pyx_L1_error)
14515 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L1_error)
14516 __Pyx_GOTREF(__pyx_t_7);
14520 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14521 if (unlikely(!__pyx_t_7)) {
14522 PyObject* exc_type = PyErr_Occurred();
14524 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14525 else __PYX_ERR(0, 674, __pyx_L1_error)
14529 __Pyx_GOTREF(__pyx_t_7);
14531 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14533 __Pyx_INCREF(__pyx_t_3);
14534 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14535 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L1_error)
14536 __Pyx_GOTREF(__pyx_t_7);
14537 __Pyx_DECREF(__pyx_t_3);
14538 __pyx_t_3 = __pyx_t_7;
14548 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14549 __pyx_t_1 = (__pyx_t_2 != 0);
14559 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14569 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 677, __pyx_L1_error)
14570 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 677, __pyx_L1_error)
14571 __Pyx_GOTREF(__pyx_t_7);
14572 { Py_ssize_t __pyx_temp;
14573 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14574 __Pyx_INCREF(__pyx_slice__27);
14575 __Pyx_GIVEREF(__pyx_slice__27);
14576 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__27);
14579 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 677, __pyx_L1_error)
14580 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14589 __pyx_v_seen_ellipsis = 1;
14609 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__28);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 680, __pyx_L1_error)
14620 __pyx_v_have_slices = 1;
14640 __pyx_t_2 = PySlice_Check(__pyx_v_item);
14641 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14644 __pyx_t_1 = __pyx_t_10;
14645 goto __pyx_L9_bool_binop_done;
14647 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14648 __pyx_t_1 = __pyx_t_10;
14649 __pyx_L9_bool_binop_done:;
14650 if (unlikely(__pyx_t_1)) {
14659 __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 684, __pyx_L1_error)
14660 __Pyx_GOTREF(__pyx_t_7);
14661 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 684, __pyx_L1_error)
14662 __Pyx_GOTREF(__pyx_t_11);
14663 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14664 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14665 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14666 __PYX_ERR(0, 684, __pyx_L1_error)
14684 __pyx_t_10 = (__pyx_v_have_slices != 0);
14687 __pyx_t_1 = __pyx_t_10;
14688 goto __pyx_L11_bool_binop_done;
14690 __pyx_t_10 = PySlice_Check(__pyx_v_item);
14691 __pyx_t_2 = (__pyx_t_10 != 0);
14692 __pyx_t_1 = __pyx_t_2;
14693 __pyx_L11_bool_binop_done:;
14694 __pyx_v_have_slices = __pyx_t_1;
14703 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 687, __pyx_L1_error)
14715 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14716 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14725 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 689, __pyx_L1_error)
14726 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14735 __pyx_t_1 = (__pyx_v_nslices != 0);
14745 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
14746 __Pyx_GOTREF(__pyx_t_3);
14747 { Py_ssize_t __pyx_temp;
14748 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14749 __Pyx_INCREF(__pyx_slice__29);
14750 __Pyx_GIVEREF(__pyx_slice__29);
14751 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__29);
14754 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 691, __pyx_L1_error)
14755 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14773 __Pyx_XDECREF(__pyx_r);
14774 if (!__pyx_v_have_slices) {
14776 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
14777 __Pyx_GOTREF(__pyx_t_4);
14778 __pyx_t_3 = __pyx_t_4;
14780 goto __pyx_L14_bool_binop_done;
14782 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
14783 __Pyx_GOTREF(__pyx_t_4);
14784 __pyx_t_3 = __pyx_t_4;
14786 __pyx_L14_bool_binop_done:;
14787 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
14788 __Pyx_GOTREF(__pyx_t_4);
14789 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 693, __pyx_L1_error)
14790 __Pyx_GOTREF(__pyx_t_11);
14791 __Pyx_GIVEREF(__pyx_t_3);
14792 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14793 __Pyx_GIVEREF(__pyx_t_4);
14794 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14797 __pyx_r = ((PyObject*)__pyx_t_11);
14811 __Pyx_XDECREF(__pyx_t_3);
14812 __Pyx_XDECREF(__pyx_t_4);
14813 __Pyx_XDECREF(__pyx_t_7);
14814 __Pyx_XDECREF(__pyx_t_11);
14815 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14818 __Pyx_XDECREF(__pyx_v_tup);
14819 __Pyx_XDECREF(__pyx_v_result);
14820 __Pyx_XDECREF(__pyx_v_idx);
14821 __Pyx_XDECREF(__pyx_v_item);
14822 __Pyx_XGIVEREF(__pyx_r);
14823 __Pyx_RefNannyFinishContext();
14835 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
14836 Py_ssize_t __pyx_v_suboffset;
14837 PyObject *__pyx_r = NULL;
14838 __Pyx_RefNannyDeclarations
14839 Py_ssize_t *__pyx_t_1;
14840 Py_ssize_t *__pyx_t_2;
14841 Py_ssize_t *__pyx_t_3;
14843 PyObject *__pyx_t_5 = NULL;
14844 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
14853 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14854 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14855 __pyx_t_1 = __pyx_t_3;
14856 __pyx_v_suboffset = (__pyx_t_1[0]);
14865 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14866 if (unlikely(__pyx_t_4)) {
14875 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error)
14876 __Pyx_GOTREF(__pyx_t_5);
14877 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14878 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14879 __PYX_ERR(0, 698, __pyx_L1_error)
14900 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14903 __Pyx_XDECREF(__pyx_t_5);
14904 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14907 __Pyx_XGIVEREF(__pyx_r);
14908 __Pyx_RefNannyFinishContext();
14920 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14921 int __pyx_v_new_ndim;
14922 int __pyx_v_suboffset_dim;
14924 __Pyx_memviewslice __pyx_v_src;
14925 __Pyx_memviewslice __pyx_v_dst;
14926 __Pyx_memviewslice *__pyx_v_p_src;
14927 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14928 __Pyx_memviewslice *__pyx_v_p_dst;
14929 int *__pyx_v_p_suboffset_dim;
14930 Py_ssize_t __pyx_v_start;
14931 Py_ssize_t __pyx_v_stop;
14932 Py_ssize_t __pyx_v_step;
14933 int __pyx_v_have_start;
14934 int __pyx_v_have_stop;
14935 int __pyx_v_have_step;
14936 PyObject *__pyx_v_index = NULL;
14937 struct __pyx_memoryview_obj *__pyx_r = NULL;
14938 __Pyx_RefNannyDeclarations
14941 PyObject *__pyx_t_3 = NULL;
14942 struct __pyx_memoryview_obj *__pyx_t_4;
14945 Py_ssize_t __pyx_t_7;
14946 PyObject *(*__pyx_t_8)(PyObject *);
14947 PyObject *__pyx_t_9 = NULL;
14948 Py_ssize_t __pyx_t_10;
14950 Py_ssize_t __pyx_t_12;
14951 __Pyx_RefNannySetupContext(
"memview_slice", 0);
14960 __pyx_v_new_ndim = 0;
14961 __pyx_v_suboffset_dim = -1;
14970 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
14979 #ifndef CYTHON_WITHOUT_ASSERTIONS 14980 if (unlikely(!Py_OptimizeFlag)) {
14981 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14982 PyErr_SetNone(PyExc_AssertionError);
14983 __PYX_ERR(0, 717, __pyx_L1_error)
14995 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14996 __pyx_t_2 = (__pyx_t_1 != 0);
15006 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 720, __pyx_L1_error)
15007 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15008 __Pyx_INCREF(__pyx_t_3);
15009 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15019 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15039 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15048 __pyx_v_p_src = (&__pyx_v_src);
15059 __pyx_t_4 = __pyx_v_p_src->memview;
15060 __pyx_v_dst.memview = __pyx_t_4;
15069 __pyx_t_5 = __pyx_v_p_src->data;
15070 __pyx_v_dst.data = __pyx_t_5;
15079 __pyx_v_p_dst = (&__pyx_v_dst);
15088 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15098 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15099 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15102 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error)
15103 __Pyx_GOTREF(__pyx_t_3);
15104 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 741, __pyx_L1_error)
15107 if (likely(!__pyx_t_8)) {
15108 if (likely(PyList_CheckExact(__pyx_t_3))) {
15109 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
15110 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 15111 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(0, 741, __pyx_L1_error)
15113 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 741, __pyx_L1_error)
15114 __Pyx_GOTREF(__pyx_t_9);
15117 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
15118 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 15119 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(0, 741, __pyx_L1_error)
15121 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 741, __pyx_L1_error)
15122 __Pyx_GOTREF(__pyx_t_9);
15126 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15127 if (unlikely(!__pyx_t_9)) {
15128 PyObject* exc_type = PyErr_Occurred();
15130 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15131 else __PYX_ERR(0, 741, __pyx_L1_error)
15135 __Pyx_GOTREF(__pyx_t_9);
15137 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15139 __pyx_v_dim = __pyx_t_6;
15140 __pyx_t_6 = (__pyx_t_6 + 1);
15149 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15159 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L1_error)
15168 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 743, __pyx_L1_error)
15187 __pyx_t_2 = (__pyx_v_index == Py_None);
15188 __pyx_t_1 = (__pyx_t_2 != 0);
15198 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15207 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15216 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15225 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15245 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 755, __pyx_L1_error)
15246 __Pyx_GOTREF(__pyx_t_9);
15247 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 755, __pyx_L1_error)
15249 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15251 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 755, __pyx_L1_error)
15252 __pyx_t_10 = __pyx_t_12;
15253 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15254 goto __pyx_L7_bool_binop_done;
15257 __pyx_L7_bool_binop_done:;
15258 __pyx_v_start = __pyx_t_10;
15267 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 756, __pyx_L1_error)
15268 __Pyx_GOTREF(__pyx_t_9);
15269 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 756, __pyx_L1_error)
15271 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15273 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 756, __pyx_L1_error)
15274 __pyx_t_10 = __pyx_t_12;
15275 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15276 goto __pyx_L9_bool_binop_done;
15279 __pyx_L9_bool_binop_done:;
15280 __pyx_v_stop = __pyx_t_10;
15289 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 757, __pyx_L1_error)
15290 __Pyx_GOTREF(__pyx_t_9);
15291 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 757, __pyx_L1_error)
15293 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15295 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L1_error)
15296 __pyx_t_10 = __pyx_t_12;
15297 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15298 goto __pyx_L11_bool_binop_done;
15301 __pyx_L11_bool_binop_done:;
15302 __pyx_v_step = __pyx_t_10;
15311 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 759, __pyx_L1_error)
15312 __Pyx_GOTREF(__pyx_t_9);
15313 __pyx_t_1 = (__pyx_t_9 != Py_None);
15314 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15315 __pyx_v_have_start = __pyx_t_1;
15324 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L1_error)
15325 __Pyx_GOTREF(__pyx_t_9);
15326 __pyx_t_1 = (__pyx_t_9 != Py_None);
15327 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15328 __pyx_v_have_stop = __pyx_t_1;
15337 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 761, __pyx_L1_error)
15338 __Pyx_GOTREF(__pyx_t_9);
15339 __pyx_t_1 = (__pyx_t_9 != Py_None);
15340 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15341 __pyx_v_have_step = __pyx_t_1;
15350 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 763, __pyx_L1_error)
15359 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15371 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15380 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15381 __pyx_t_2 = (__pyx_t_1 != 0);
15391 __Pyx_XDECREF(((PyObject *)__pyx_r));
15400 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(0, 773, __pyx_L1_error) }
15409 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(0, 774, __pyx_L1_error) }
15418 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error)
15419 __Pyx_GOTREF(__pyx_t_3);
15420 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 772, __pyx_L1_error)
15421 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15442 __Pyx_XDECREF(((PyObject *)__pyx_r));
15451 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error)
15452 __Pyx_GOTREF(__pyx_t_3);
15461 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 777, __pyx_L1_error)
15462 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15477 __Pyx_XDECREF(__pyx_t_3);
15478 __Pyx_XDECREF(__pyx_t_9);
15479 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15482 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15483 __Pyx_XDECREF(__pyx_v_index);
15484 __Pyx_XGIVEREF((PyObject *)__pyx_r);
15485 __Pyx_RefNannyFinishContext();
15497 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
15498 Py_ssize_t __pyx_v_new_shape;
15499 int __pyx_v_negative_step;
15512 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15522 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15532 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15550 __pyx_t_1 = (0 <= __pyx_v_start);
15552 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15554 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15564 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(0, 827, __pyx_L1_error)
15593 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15596 __pyx_t_2 = __pyx_t_1;
15597 goto __pyx_L6_bool_binop_done;
15599 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15600 __pyx_t_2 = __pyx_t_1;
15601 __pyx_L6_bool_binop_done:;
15602 __pyx_v_negative_step = __pyx_t_2;
15611 __pyx_t_1 = (__pyx_v_have_step != 0);
15614 __pyx_t_2 = __pyx_t_1;
15615 goto __pyx_L9_bool_binop_done;
15617 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15618 __pyx_t_2 = __pyx_t_1;
15619 __pyx_L9_bool_binop_done:;
15629 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(0, 833, __pyx_L1_error)
15647 __pyx_t_2 = (__pyx_v_have_start != 0);
15657 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15667 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15676 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15714 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15724 __pyx_t_2 = (__pyx_v_negative_step != 0);
15734 __pyx_v_start = (__pyx_v_shape - 1);
15754 __pyx_v_start = __pyx_v_shape;
15786 __pyx_t_2 = (__pyx_v_negative_step != 0);
15796 __pyx_v_start = (__pyx_v_shape - 1);
15829 __pyx_t_2 = (__pyx_v_have_stop != 0);
15839 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15849 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15858 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15896 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15906 __pyx_v_stop = __pyx_v_shape;
15936 __pyx_t_2 = (__pyx_v_negative_step != 0);
15946 __pyx_v_stop = -1L;
15966 __pyx_v_stop = __pyx_v_shape;
15979 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16007 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16016 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16026 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16044 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16054 __pyx_v_new_shape = 0;
16072 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16081 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16090 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16101 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16111 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16131 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16132 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16143 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16153 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16163 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16173 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16201 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(0, 894, __pyx_L1_error)
16223 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16258 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16260 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16262 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16278 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16279 Py_ssize_t __pyx_v_shape;
16280 Py_ssize_t __pyx_v_stride;
16281 Py_ssize_t __pyx_v_suboffset;
16282 Py_ssize_t __pyx_v_itemsize;
16283 char *__pyx_v_resultp;
16285 __Pyx_RefNannyDeclarations
16286 Py_ssize_t __pyx_t_1;
16288 PyObject *__pyx_t_3 = NULL;
16289 PyObject *__pyx_t_4 = NULL;
16290 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
16299 __pyx_v_suboffset = -1L;
16308 __pyx_t_1 = __pyx_v_view->itemsize;
16309 __pyx_v_itemsize = __pyx_t_1;
16318 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16328 if (unlikely(__pyx_v_itemsize == 0)) {
16329 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
16330 __PYX_ERR(0, 912, __pyx_L1_error)
16332 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16333 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
16334 __PYX_ERR(0, 912, __pyx_L1_error)
16336 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16345 __pyx_v_stride = __pyx_v_itemsize;
16365 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16374 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16383 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16393 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16413 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16423 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16432 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16433 if (unlikely(__pyx_t_2)) {
16442 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
16443 __Pyx_GOTREF(__pyx_t_3);
16444 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 923, __pyx_L1_error)
16445 __Pyx_GOTREF(__pyx_t_4);
16446 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16447 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
16448 __Pyx_GOTREF(__pyx_t_3);
16449 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16450 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16451 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16452 __PYX_ERR(0, 923, __pyx_L1_error)
16479 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16480 if (unlikely(__pyx_t_2)) {
16489 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L1_error)
16490 __Pyx_GOTREF(__pyx_t_3);
16491 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 926, __pyx_L1_error)
16492 __Pyx_GOTREF(__pyx_t_4);
16493 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16494 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L1_error)
16495 __Pyx_GOTREF(__pyx_t_3);
16496 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16497 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16498 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16499 __PYX_ERR(0, 926, __pyx_L1_error)
16517 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16526 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16536 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16554 __pyx_r = __pyx_v_resultp;
16567 __Pyx_XDECREF(__pyx_t_3);
16568 __Pyx_XDECREF(__pyx_t_4);
16569 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16572 __Pyx_RefNannyFinishContext();
16584 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16586 Py_ssize_t *__pyx_v_shape;
16587 Py_ssize_t *__pyx_v_strides;
16592 Py_ssize_t *__pyx_t_2;
16595 Py_ssize_t __pyx_t_5;
16596 Py_ssize_t __pyx_t_6;
16608 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16609 __pyx_v_ndim = __pyx_t_1;
16618 __pyx_t_2 = __pyx_v_memslice->shape;
16619 __pyx_v_shape = __pyx_t_2;
16628 __pyx_t_2 = __pyx_v_memslice->strides;
16629 __pyx_v_strides = __pyx_t_2;
16638 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16639 __pyx_t_4 = __pyx_t_3;
16640 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16641 __pyx_v_i = __pyx_t_1;
16650 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16659 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16660 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16661 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16662 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16671 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16672 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16673 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16674 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16683 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16686 __pyx_t_7 = __pyx_t_8;
16687 goto __pyx_L6_bool_binop_done;
16689 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16690 __pyx_t_7 = __pyx_t_8;
16691 __pyx_L6_bool_binop_done:;
16701 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 952, __pyx_L1_error)
16735 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16737 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16739 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16756 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
16757 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16758 __Pyx_RefNannyDeclarations
16759 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
16760 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16763 __Pyx_RefNannyFinishContext();
16766 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16767 __Pyx_RefNannyDeclarations
16768 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
16777 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16788 __Pyx_RefNannyFinishContext();
16799 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
16800 PyObject *__pyx_r = NULL;
16801 __Pyx_RefNannyDeclarations
16803 PyObject *__pyx_t_2 = NULL;
16804 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
16813 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16823 __Pyx_XDECREF(__pyx_r);
16824 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
16825 __Pyx_GOTREF(__pyx_t_2);
16826 __pyx_r = __pyx_t_2;
16847 __Pyx_XDECREF(__pyx_r);
16848 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
16849 __Pyx_GOTREF(__pyx_t_2);
16850 __pyx_r = __pyx_t_2;
16865 __Pyx_XDECREF(__pyx_t_2);
16866 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16869 __Pyx_XGIVEREF(__pyx_r);
16870 __Pyx_RefNannyFinishContext();
16882 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16883 PyObject *__pyx_r = NULL;
16884 __Pyx_RefNannyDeclarations
16887 PyObject *__pyx_t_3 = NULL;
16888 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
16897 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16907 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(0, 982, __pyx_L1_error)
16927 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
16928 __Pyx_GOTREF(__pyx_t_3);
16929 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16942 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16945 __Pyx_XDECREF(__pyx_t_3);
16946 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16949 __Pyx_XGIVEREF(__pyx_r);
16950 __Pyx_RefNannyFinishContext();
16963 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
16964 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16965 PyObject *__pyx_r = 0;
16966 __Pyx_RefNannyDeclarations
16967 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
16968 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16971 __Pyx_RefNannyFinishContext();
16975 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16976 PyObject *__pyx_r = NULL;
16977 __Pyx_RefNannyDeclarations
16978 __Pyx_RefNannySetupContext(
"__get__", 0);
16987 __Pyx_XDECREF(__pyx_r);
16988 __Pyx_INCREF(__pyx_v_self->from_object);
16989 __pyx_r = __pyx_v_self->from_object;
17002 __Pyx_XGIVEREF(__pyx_r);
17003 __Pyx_RefNannyFinishContext();
17014 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17015 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17016 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17017 PyObject *__pyx_r = 0;
17018 __Pyx_RefNannyDeclarations
17019 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
17020 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17023 __Pyx_RefNannyFinishContext();
17027 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17028 PyObject *__pyx_r = NULL;
17029 __Pyx_RefNannyDeclarations
17030 PyObject *__pyx_t_1 = NULL;
17031 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
17039 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
17040 __Pyx_GOTREF(__pyx_t_1);
17041 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17043 __PYX_ERR(0, 2, __pyx_L1_error)
17053 __Pyx_XDECREF(__pyx_t_1);
17054 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17056 __Pyx_XGIVEREF(__pyx_r);
17057 __Pyx_RefNannyFinishContext();
17069 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
17070 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17071 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17072 PyObject *__pyx_r = 0;
17073 __Pyx_RefNannyDeclarations
17074 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
17075 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17078 __Pyx_RefNannyFinishContext();
17082 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17083 PyObject *__pyx_r = NULL;
17084 __Pyx_RefNannyDeclarations
17085 PyObject *__pyx_t_1 = NULL;
17086 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
17093 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
17094 __Pyx_GOTREF(__pyx_t_1);
17095 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17096 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17097 __PYX_ERR(0, 4, __pyx_L1_error)
17108 __Pyx_XDECREF(__pyx_t_1);
17109 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17111 __Pyx_XGIVEREF(__pyx_r);
17112 __Pyx_RefNannyFinishContext();
17124 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
17125 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17126 Py_ssize_t __pyx_v_suboffset;
17127 PyObject *__pyx_v_length = NULL;
17128 PyObject *__pyx_r = NULL;
17129 __Pyx_RefNannyDeclarations
17131 PyObject *__pyx_t_2 = NULL;
17132 PyObject *__pyx_t_3 = NULL;
17133 __Pyx_TypeInfo *__pyx_t_4;
17134 Py_buffer __pyx_t_5;
17135 Py_ssize_t *__pyx_t_6;
17136 Py_ssize_t *__pyx_t_7;
17137 Py_ssize_t *__pyx_t_8;
17138 Py_ssize_t __pyx_t_9;
17139 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
17148 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17158 __Pyx_XDECREF(__pyx_r);
17159 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17178 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error)
17179 __Pyx_GOTREF(__pyx_t_2);
17180 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1008, __pyx_L1_error)
17181 __Pyx_GOTREF(__pyx_t_3);
17182 __Pyx_INCREF(Py_None);
17183 __Pyx_GIVEREF(Py_None);
17184 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17185 __Pyx_INCREF(__pyx_int_0);
17186 __Pyx_GIVEREF(__pyx_int_0);
17187 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17188 __Pyx_GIVEREF(__pyx_t_2);
17189 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17191 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error)
17192 __Pyx_GOTREF(__pyx_t_2);
17193 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17194 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17204 __pyx_v_result->from_slice = __pyx_v_memviewslice;
17213 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17222 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
17223 __Pyx_GOTREF(__pyx_t_2);
17224 __Pyx_GIVEREF(__pyx_t_2);
17225 __Pyx_GOTREF(__pyx_v_result->from_object);
17226 __Pyx_DECREF(__pyx_v_result->from_object);
17227 __pyx_v_result->from_object = __pyx_t_2;
17237 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17238 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17247 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17248 __pyx_v_result->__pyx_base.view = __pyx_t_5;
17257 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
17266 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17275 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17284 Py_INCREF(Py_None);
17293 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17303 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17323 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17334 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17343 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17352 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17361 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17362 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17363 __pyx_t_6 = __pyx_t_8;
17364 __pyx_v_suboffset = (__pyx_t_6[0]);
17373 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17383 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17392 goto __pyx_L6_break;
17412 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17413 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17422 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17423 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17424 __pyx_t_6 = __pyx_t_8;
17425 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1038, __pyx_L1_error)
17426 __Pyx_GOTREF(__pyx_t_2);
17427 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17437 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error)
17438 __Pyx_GOTREF(__pyx_t_2);
17439 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error)
17440 __Pyx_GOTREF(__pyx_t_3);
17441 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17442 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error)
17443 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17444 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17454 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17463 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17472 __Pyx_XDECREF(__pyx_r);
17473 __Pyx_INCREF(((PyObject *)__pyx_v_result));
17474 __pyx_r = ((PyObject *)__pyx_v_result);
17487 __Pyx_XDECREF(__pyx_t_2);
17488 __Pyx_XDECREF(__pyx_t_3);
17489 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17492 __Pyx_XDECREF((PyObject *)__pyx_v_result);
17493 __Pyx_XDECREF(__pyx_v_length);
17494 __Pyx_XGIVEREF(__pyx_r);
17495 __Pyx_RefNannyFinishContext();
17507 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17508 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17509 __Pyx_memviewslice *__pyx_r;
17510 __Pyx_RefNannyDeclarations
17513 PyObject *__pyx_t_3 = NULL;
17514 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
17523 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17524 __pyx_t_2 = (__pyx_t_1 != 0);
17534 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 1051, __pyx_L1_error)
17535 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17536 __Pyx_INCREF(__pyx_t_3);
17537 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17547 __pyx_r = (&__pyx_v_obj->from_slice);
17567 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17576 __pyx_r = __pyx_v_mslice;
17590 __Pyx_XDECREF(__pyx_t_3);
17591 __Pyx_WriteUnraisable(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17594 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17595 __Pyx_RefNannyFinishContext();
17607 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17609 Py_ssize_t *__pyx_v_shape;
17610 Py_ssize_t *__pyx_v_strides;
17611 Py_ssize_t *__pyx_v_suboffsets;
17612 __Pyx_RefNannyDeclarations
17613 Py_ssize_t *__pyx_t_1;
17617 Py_ssize_t __pyx_t_5;
17618 __Pyx_RefNannySetupContext(
"slice_copy", 0);
17627 __pyx_t_1 = __pyx_v_memview->view.shape;
17628 __pyx_v_shape = __pyx_t_1;
17637 __pyx_t_1 = __pyx_v_memview->view.strides;
17638 __pyx_v_strides = __pyx_t_1;
17647 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17648 __pyx_v_suboffsets = __pyx_t_1;
17657 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
17666 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
17675 __pyx_t_2 = __pyx_v_memview->view.ndim;
17676 __pyx_t_3 = __pyx_t_2;
17677 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17678 __pyx_v_dim = __pyx_t_4;
17687 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17696 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17705 if ((__pyx_v_suboffsets != 0)) {
17706 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17710 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17722 __Pyx_RefNannyFinishContext();
17733 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
17734 __Pyx_memviewslice __pyx_v_memviewslice;
17735 PyObject *__pyx_r = NULL;
17736 __Pyx_RefNannyDeclarations
17737 PyObject *__pyx_t_1 = NULL;
17738 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
17747 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17756 __Pyx_XDECREF(__pyx_r);
17757 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1079, __pyx_L1_error)
17758 __Pyx_GOTREF(__pyx_t_1);
17759 __pyx_r = __pyx_t_1;
17773 __Pyx_XDECREF(__pyx_t_1);
17774 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17777 __Pyx_XGIVEREF(__pyx_r);
17778 __Pyx_RefNannyFinishContext();
17790 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17791 PyObject *(*__pyx_v_to_object_func)(
char *);
17792 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
17793 PyObject *__pyx_r = NULL;
17794 __Pyx_RefNannyDeclarations
17797 PyObject *(*__pyx_t_3)(
char *);
17798 int (*__pyx_t_4)(
char *, PyObject *);
17799 PyObject *__pyx_t_5 = NULL;
17800 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
17809 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17810 __pyx_t_2 = (__pyx_t_1 != 0);
17820 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17821 __pyx_v_to_object_func = __pyx_t_3;
17830 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17831 __pyx_v_to_dtype_func = __pyx_t_4;
17851 __pyx_v_to_object_func = NULL;
17860 __pyx_v_to_dtype_func = NULL;
17871 __Pyx_XDECREF(__pyx_r);
17880 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error)
17881 __Pyx_GOTREF(__pyx_t_5);
17882 __pyx_r = __pyx_t_5;
17896 __Pyx_XDECREF(__pyx_t_5);
17897 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17900 __Pyx_XGIVEREF(__pyx_r);
17901 __Pyx_RefNannyFinishContext();
17913 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17914 Py_ssize_t __pyx_r;
17924 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17934 __pyx_r = (-__pyx_v_arg);
17954 __pyx_r = __pyx_v_arg;
17979 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
17981 Py_ssize_t __pyx_v_c_stride;
17982 Py_ssize_t __pyx_v_f_stride;
17996 __pyx_v_c_stride = 0;
18005 __pyx_v_f_stride = 0;
18014 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18015 __pyx_v_i = __pyx_t_1;
18024 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18034 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18043 goto __pyx_L4_break;
18063 __pyx_t_1 = __pyx_v_ndim;
18064 __pyx_t_3 = __pyx_t_1;
18065 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18066 __pyx_v_i = __pyx_t_4;
18075 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18085 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18094 goto __pyx_L7_break;
18114 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18169 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18170 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18171 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18172 Py_ssize_t __pyx_v_dst_extent;
18173 Py_ssize_t __pyx_v_src_stride;
18174 Py_ssize_t __pyx_v_dst_stride;
18178 Py_ssize_t __pyx_t_4;
18179 Py_ssize_t __pyx_t_5;
18180 Py_ssize_t __pyx_t_6;
18189 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18198 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18207 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18216 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18225 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18235 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18238 __pyx_t_1 = __pyx_t_2;
18239 goto __pyx_L5_bool_binop_done;
18241 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18244 __pyx_t_1 = __pyx_t_2;
18245 goto __pyx_L5_bool_binop_done;
18255 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18257 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18259 __pyx_t_3 = (__pyx_t_2 != 0);
18260 __pyx_t_1 = __pyx_t_3;
18261 __pyx_L5_bool_binop_done:;
18279 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18299 __pyx_t_4 = __pyx_v_dst_extent;
18300 __pyx_t_5 = __pyx_t_4;
18301 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18302 __pyx_v_i = __pyx_t_6;
18311 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18320 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18329 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18352 __pyx_t_4 = __pyx_v_dst_extent;
18353 __pyx_t_5 = __pyx_t_4;
18354 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18355 __pyx_v_i = __pyx_t_6;
18364 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18373 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18382 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18406 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18415 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18436 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
18438 Py_ssize_t __pyx_v_size;
18439 Py_ssize_t __pyx_r;
18440 Py_ssize_t __pyx_t_1;
18452 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18453 __pyx_v_size = __pyx_t_1;
18462 __pyx_t_2 = __pyx_v_ndim;
18463 __pyx_t_3 = __pyx_t_2;
18464 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18465 __pyx_v_i = __pyx_t_4;
18474 __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
18484 __pyx_r = __pyx_v_size;
18508 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
18510 Py_ssize_t __pyx_r;
18523 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
18533 __pyx_t_2 = __pyx_v_ndim;
18534 __pyx_t_3 = __pyx_t_2;
18535 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18536 __pyx_v_idx = __pyx_t_4;
18545 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18554 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18575 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18576 __pyx_v_idx = __pyx_t_2;
18585 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18594 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18606 __pyx_r = __pyx_v_stride;
18630 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
18632 void *__pyx_v_result;
18633 size_t __pyx_v_itemsize;
18634 size_t __pyx_v_size;
18636 Py_ssize_t __pyx_t_1;
18639 struct __pyx_memoryview_obj *__pyx_t_4;
18650 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18651 __pyx_v_itemsize = __pyx_t_1;
18660 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18669 __pyx_v_result = malloc(__pyx_v_size);
18678 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18688 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(0, 1220, __pyx_L1_error)
18706 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
18715 __pyx_t_4 = __pyx_v_src->memview;
18716 __pyx_v_tmpslice->memview = __pyx_t_4;
18725 __pyx_t_3 = __pyx_v_ndim;
18726 __pyx_t_5 = __pyx_t_3;
18727 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18728 __pyx_v_i = __pyx_t_6;
18737 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18746 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18756 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18765 __pyx_t_3 = __pyx_v_ndim;
18766 __pyx_t_5 = __pyx_t_3;
18767 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18768 __pyx_v_i = __pyx_t_6;
18777 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18787 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18806 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18816 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18836 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18847 __pyx_r = __pyx_v_result;
18862 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18864 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18866 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18882 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18884 __Pyx_RefNannyDeclarations
18885 PyObject *__pyx_t_1 = NULL;
18886 PyObject *__pyx_t_2 = NULL;
18887 PyObject *__pyx_t_3 = NULL;
18888 PyObject *__pyx_t_4 = NULL;
18890 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18892 __Pyx_RefNannySetupContext(
"_err_extents", 0);
18901 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error)
18902 __Pyx_GOTREF(__pyx_t_1);
18903 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1250, __pyx_L1_error)
18904 __Pyx_GOTREF(__pyx_t_2);
18905 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1250, __pyx_L1_error)
18906 __Pyx_GOTREF(__pyx_t_3);
18907 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __pyx_L1_error)
18908 __Pyx_GOTREF(__pyx_t_4);
18909 __Pyx_GIVEREF(__pyx_t_1);
18910 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18911 __Pyx_GIVEREF(__pyx_t_2);
18912 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18913 __Pyx_GIVEREF(__pyx_t_3);
18914 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18926 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1249, __pyx_L1_error)
18927 __Pyx_GOTREF(__pyx_t_3);
18928 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18929 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1249, __pyx_L1_error)
18930 __Pyx_GOTREF(__pyx_t_4);
18931 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18932 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18933 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18934 __PYX_ERR(0, 1249, __pyx_L1_error)
18946 __Pyx_XDECREF(__pyx_t_1);
18947 __Pyx_XDECREF(__pyx_t_2);
18948 __Pyx_XDECREF(__pyx_t_3);
18949 __Pyx_XDECREF(__pyx_t_4);
18950 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18952 __Pyx_RefNannyFinishContext();
18954 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18967 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
18969 __Pyx_RefNannyDeclarations
18970 PyObject *__pyx_t_1 = NULL;
18971 PyObject *__pyx_t_2 = NULL;
18972 PyObject *__pyx_t_3 = NULL;
18973 PyObject *__pyx_t_4 = NULL;
18974 PyObject *__pyx_t_5 = NULL;
18976 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18978 __Pyx_RefNannySetupContext(
"_err_dim", 0);
18979 __Pyx_INCREF(__pyx_v_error);
18988 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1254, __pyx_L1_error)
18989 __Pyx_GOTREF(__pyx_t_2);
18990 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error)
18991 __Pyx_GOTREF(__pyx_t_3);
18992 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1254, __pyx_L1_error)
18993 __Pyx_GOTREF(__pyx_t_4);
18994 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18995 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18996 __Pyx_INCREF(__pyx_v_error);
18997 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
18998 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18999 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19000 if (likely(__pyx_t_2)) {
19001 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19002 __Pyx_INCREF(__pyx_t_2);
19003 __Pyx_INCREF(
function);
19004 __Pyx_DECREF_SET(__pyx_t_3,
function);
19008 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
19009 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19010 __Pyx_GOTREF(__pyx_t_1);
19012 #if CYTHON_FAST_PYCALL 19013 if (PyFunction_Check(__pyx_t_3)) {
19014 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19015 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
19016 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19017 __Pyx_GOTREF(__pyx_t_1);
19018 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19021 #if CYTHON_FAST_PYCCALL 19022 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
19023 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19024 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
19025 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19026 __Pyx_GOTREF(__pyx_t_1);
19027 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19031 __pyx_t_5 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1254, __pyx_L1_error)
19032 __Pyx_GOTREF(__pyx_t_5);
19033 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
19034 __Pyx_GIVEREF(__pyx_t_4);
19035 PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
19037 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
19038 __Pyx_GOTREF(__pyx_t_1);
19039 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19042 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19043 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19044 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19045 __PYX_ERR(0, 1254, __pyx_L1_error)
19057 __Pyx_XDECREF(__pyx_t_1);
19058 __Pyx_XDECREF(__pyx_t_2);
19059 __Pyx_XDECREF(__pyx_t_3);
19060 __Pyx_XDECREF(__pyx_t_4);
19061 __Pyx_XDECREF(__pyx_t_5);
19062 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19064 __Pyx_XDECREF(__pyx_v_error);
19065 __Pyx_RefNannyFinishContext();
19067 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19080 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
19082 __Pyx_RefNannyDeclarations
19084 PyObject *__pyx_t_2 = NULL;
19085 PyObject *__pyx_t_3 = NULL;
19086 PyObject *__pyx_t_4 = NULL;
19087 PyObject *__pyx_t_5 = NULL;
19088 PyObject *__pyx_t_6 = NULL;
19090 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19092 __Pyx_RefNannySetupContext(
"_err", 0);
19093 __Pyx_INCREF(__pyx_v_error);
19102 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19103 if (unlikely(__pyx_t_1)) {
19112 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error)
19113 __Pyx_GOTREF(__pyx_t_3);
19114 __Pyx_INCREF(__pyx_v_error);
19115 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19116 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19117 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19118 if (likely(__pyx_t_5)) {
19119 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
19120 __Pyx_INCREF(__pyx_t_5);
19121 __Pyx_INCREF(
function);
19122 __Pyx_DECREF_SET(__pyx_t_4,
function);
19126 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error)
19127 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19128 __Pyx_GOTREF(__pyx_t_2);
19130 #if CYTHON_FAST_PYCALL 19131 if (PyFunction_Check(__pyx_t_4)) {
19132 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19133 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error)
19134 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19135 __Pyx_GOTREF(__pyx_t_2);
19136 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19139 #if CYTHON_FAST_PYCCALL 19140 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
19141 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19142 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error)
19143 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19144 __Pyx_GOTREF(__pyx_t_2);
19145 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19149 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1259, __pyx_L1_error)
19150 __Pyx_GOTREF(__pyx_t_6);
19151 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
19152 __Pyx_GIVEREF(__pyx_t_3);
19153 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
19155 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error)
19156 __Pyx_GOTREF(__pyx_t_2);
19157 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19160 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19161 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19162 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19163 __PYX_ERR(0, 1259, __pyx_L1_error)
19182 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19183 __PYX_ERR(0, 1261, __pyx_L1_error)
19196 __Pyx_XDECREF(__pyx_t_2);
19197 __Pyx_XDECREF(__pyx_t_3);
19198 __Pyx_XDECREF(__pyx_t_4);
19199 __Pyx_XDECREF(__pyx_t_5);
19200 __Pyx_XDECREF(__pyx_t_6);
19201 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19203 __Pyx_XDECREF(__pyx_v_error);
19204 __Pyx_RefNannyFinishContext();
19206 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19219 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
19220 void *__pyx_v_tmpdata;
19221 size_t __pyx_v_itemsize;
19223 char __pyx_v_order;
19224 int __pyx_v_broadcasting;
19225 int __pyx_v_direct_copy;
19226 __Pyx_memviewslice __pyx_v_tmp;
19229 Py_ssize_t __pyx_t_1;
19245 __pyx_v_tmpdata = NULL;
19254 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19255 __pyx_v_itemsize = __pyx_t_1;
19264 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19273 __pyx_v_broadcasting = 0;
19282 __pyx_v_direct_copy = 0;
19291 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19301 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19320 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19330 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19349 __pyx_t_3 = __pyx_v_dst_ndim;
19350 __pyx_t_4 = __pyx_v_src_ndim;
19351 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19352 __pyx_t_5 = __pyx_t_3;
19354 __pyx_t_5 = __pyx_t_4;
19356 __pyx_v_ndim = __pyx_t_5;
19365 __pyx_t_5 = __pyx_v_ndim;
19366 __pyx_t_3 = __pyx_t_5;
19367 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19368 __pyx_v_i = __pyx_t_4;
19377 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19387 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19397 __pyx_v_broadcasting = 1;
19406 (__pyx_v_src.strides[__pyx_v_i]) = 0;
19426 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(0, 1293, __pyx_L1_error)
19446 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19456 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(0, 1296, __pyx_L1_error)
19475 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19485 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19495 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19513 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(0, 1303, __pyx_L1_error)
19514 __pyx_v_tmpdata = __pyx_t_7;
19523 __pyx_v_src = __pyx_v_tmp;
19541 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19551 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
19561 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
19580 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
19590 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
19609 __pyx_t_2 = (__pyx_v_direct_copy != 0);
19619 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19628 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19637 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19646 free(__pyx_v_tmpdata);
19683 __pyx_t_2 = (__pyx_v_order ==
'F');
19685 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19687 __pyx_t_8 = (__pyx_t_2 != 0);
19697 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(0, 1325, __pyx_L1_error)
19706 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(0, 1326, __pyx_L1_error)
19724 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19733 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19742 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19751 free(__pyx_v_tmpdata);
19775 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19777 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19779 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19795 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
19797 int __pyx_v_offset;
19809 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19818 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19819 __pyx_v_i = __pyx_t_1;
19828 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19837 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19846 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19856 __pyx_t_1 = __pyx_v_offset;
19857 __pyx_t_2 = __pyx_t_1;
19858 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19859 __pyx_v_i = __pyx_t_3;
19868 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19877 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19886 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19908 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
19918 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19928 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19958 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
19959 __Pyx_RefNannyDeclarations
19961 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19963 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
19972 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19983 __Pyx_RefNannyFinishContext();
19985 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19997 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
19998 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19999 __Pyx_RefNannyDeclarations
20000 Py_ssize_t __pyx_t_1;
20001 Py_ssize_t __pyx_t_2;
20002 Py_ssize_t __pyx_t_3;
20004 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20013 __pyx_t_1 = (__pyx_v_shape[0]);
20014 __pyx_t_2 = __pyx_t_1;
20015 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20016 __pyx_v_i = __pyx_t_3;
20025 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20035 __pyx_t_4 = (__pyx_v_inc != 0);
20045 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20065 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20095 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20106 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20118 __Pyx_RefNannyFinishContext();
20129 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
20138 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20147 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20156 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20177 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
20178 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20179 Py_ssize_t __pyx_v_stride;
20180 Py_ssize_t __pyx_v_extent;
20182 Py_ssize_t __pyx_t_2;
20183 Py_ssize_t __pyx_t_3;
20184 Py_ssize_t __pyx_t_4;
20193 __pyx_v_stride = (__pyx_v_strides[0]);
20202 __pyx_v_extent = (__pyx_v_shape[0]);
20211 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20221 __pyx_t_2 = __pyx_v_extent;
20222 __pyx_t_3 = __pyx_t_2;
20223 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20224 __pyx_v_i = __pyx_t_4;
20233 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20242 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20263 __pyx_t_2 = __pyx_v_extent;
20264 __pyx_t_3 = __pyx_t_2;
20265 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20266 __pyx_v_i = __pyx_t_4;
20275 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20284 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20307 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20308 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20309 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20310 PyObject *__pyx_v___pyx_type = 0;
20311 long __pyx_v___pyx_checksum;
20312 PyObject *__pyx_v___pyx_state = 0;
20313 PyObject *__pyx_r = 0;
20314 __Pyx_RefNannyDeclarations
20315 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
20317 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20318 PyObject* values[3] = {0,0,0};
20319 if (unlikely(__pyx_kwds)) {
20320 Py_ssize_t kw_args;
20321 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20322 switch (pos_args) {
20323 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20324 CYTHON_FALLTHROUGH;
20325 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20326 CYTHON_FALLTHROUGH;
20327 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20328 CYTHON_FALLTHROUGH;
20330 default:
goto __pyx_L5_argtuple_error;
20332 kw_args = PyDict_Size(__pyx_kwds);
20333 switch (pos_args) {
20335 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20336 else goto __pyx_L5_argtuple_error;
20337 CYTHON_FALLTHROUGH;
20339 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20341 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error)
20343 CYTHON_FALLTHROUGH;
20345 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20347 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error)
20350 if (unlikely(kw_args > 0)) {
20351 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(0, 1, __pyx_L3_error)
20353 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20354 goto __pyx_L5_argtuple_error;
20356 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20357 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20358 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20360 __pyx_v___pyx_type = values[0];
20361 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error)
20362 __pyx_v___pyx_state = values[2];
20364 goto __pyx_L4_argument_unpacking_done;
20365 __pyx_L5_argtuple_error:;
20366 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error)
20368 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20369 __Pyx_RefNannyFinishContext();
20371 __pyx_L4_argument_unpacking_done:;
20372 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20375 __Pyx_RefNannyFinishContext();
20379 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20380 PyObject *__pyx_v___pyx_PickleError = NULL;
20381 PyObject *__pyx_v___pyx_result = NULL;
20382 PyObject *__pyx_r = NULL;
20383 __Pyx_RefNannyDeclarations
20385 PyObject *__pyx_t_2 = NULL;
20386 PyObject *__pyx_t_3 = NULL;
20387 PyObject *__pyx_t_4 = NULL;
20388 PyObject *__pyx_t_5 = NULL;
20389 PyObject *__pyx_t_6 = NULL;
20391 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
20399 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20409 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
20410 __Pyx_GOTREF(__pyx_t_2);
20411 __Pyx_INCREF(__pyx_n_s_PickleError);
20412 __Pyx_GIVEREF(__pyx_n_s_PickleError);
20413 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20414 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error)
20415 __Pyx_GOTREF(__pyx_t_3);
20416 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20417 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
20418 __Pyx_GOTREF(__pyx_t_2);
20419 __Pyx_INCREF(__pyx_t_2);
20420 __pyx_v___pyx_PickleError = __pyx_t_2;
20421 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20422 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20431 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
20432 __Pyx_GOTREF(__pyx_t_2);
20433 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4, __pyx_L1_error)
20434 __Pyx_GOTREF(__pyx_t_4);
20435 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20436 __Pyx_INCREF(__pyx_v___pyx_PickleError);
20437 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20438 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20439 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20440 if (likely(__pyx_t_5)) {
20441 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
20442 __Pyx_INCREF(__pyx_t_5);
20443 __Pyx_INCREF(
function);
20444 __Pyx_DECREF_SET(__pyx_t_2,
function);
20448 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
20449 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20450 __Pyx_GOTREF(__pyx_t_3);
20452 #if CYTHON_FAST_PYCALL 20453 if (PyFunction_Check(__pyx_t_2)) {
20454 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
20455 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
20456 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20457 __Pyx_GOTREF(__pyx_t_3);
20458 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20461 #if CYTHON_FAST_PYCCALL 20462 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
20463 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
20464 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
20465 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20466 __Pyx_GOTREF(__pyx_t_3);
20467 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20471 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4, __pyx_L1_error)
20472 __Pyx_GOTREF(__pyx_t_6);
20473 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
20474 __Pyx_GIVEREF(__pyx_t_4);
20475 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
20477 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
20478 __Pyx_GOTREF(__pyx_t_3);
20479 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20482 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20483 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20484 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20485 __PYX_ERR(0, 4, __pyx_L1_error)
20502 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
20503 __Pyx_GOTREF(__pyx_t_2);
20505 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20506 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
20507 if (likely(__pyx_t_6)) {
20508 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
20509 __Pyx_INCREF(__pyx_t_6);
20510 __Pyx_INCREF(
function);
20511 __Pyx_DECREF_SET(__pyx_t_2,
function);
20515 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
20516 __Pyx_GOTREF(__pyx_t_3);
20518 #if CYTHON_FAST_PYCALL 20519 if (PyFunction_Check(__pyx_t_2)) {
20520 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
20521 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
20522 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20523 __Pyx_GOTREF(__pyx_t_3);
20526 #if CYTHON_FAST_PYCCALL 20527 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
20528 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
20529 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
20530 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20531 __Pyx_GOTREF(__pyx_t_3);
20535 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error)
20536 __Pyx_GOTREF(__pyx_t_4);
20537 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
20538 __Pyx_INCREF(__pyx_v___pyx_type);
20539 __Pyx_GIVEREF(__pyx_v___pyx_type);
20540 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
20541 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
20542 __Pyx_GOTREF(__pyx_t_3);
20543 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20546 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20547 __pyx_v___pyx_result = __pyx_t_3;
20557 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20558 __pyx_t_7 = (__pyx_t_1 != 0);
20568 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 7, __pyx_L1_error)
20569 __pyx_t_3 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
20570 __Pyx_GOTREF(__pyx_t_3);
20571 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20589 __Pyx_XDECREF(__pyx_r);
20590 __Pyx_INCREF(__pyx_v___pyx_result);
20591 __pyx_r = __pyx_v___pyx_result;
20602 __Pyx_XDECREF(__pyx_t_2);
20603 __Pyx_XDECREF(__pyx_t_3);
20604 __Pyx_XDECREF(__pyx_t_4);
20605 __Pyx_XDECREF(__pyx_t_5);
20606 __Pyx_XDECREF(__pyx_t_6);
20607 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20610 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20611 __Pyx_XDECREF(__pyx_v___pyx_result);
20612 __Pyx_XGIVEREF(__pyx_r);
20613 __Pyx_RefNannyFinishContext();
20625 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20626 PyObject *__pyx_r = NULL;
20627 __Pyx_RefNannyDeclarations
20628 PyObject *__pyx_t_1 = NULL;
20630 Py_ssize_t __pyx_t_3;
20633 PyObject *__pyx_t_6 = NULL;
20634 PyObject *__pyx_t_7 = NULL;
20635 PyObject *__pyx_t_8 = NULL;
20636 PyObject *__pyx_t_9 = NULL;
20637 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
20646 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20647 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20648 __PYX_ERR(0, 10, __pyx_L1_error)
20650 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
20651 __Pyx_GOTREF(__pyx_t_1);
20652 __Pyx_GIVEREF(__pyx_t_1);
20653 __Pyx_GOTREF(__pyx_v___pyx_result->name);
20654 __Pyx_DECREF(__pyx_v___pyx_result->name);
20655 __pyx_v___pyx_result->name = __pyx_t_1;
20664 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20665 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
20666 __PYX_ERR(0, 11, __pyx_L1_error)
20668 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 11, __pyx_L1_error)
20669 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20672 __pyx_t_2 = __pyx_t_4;
20673 goto __pyx_L4_bool_binop_done;
20675 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(0, 11, __pyx_L1_error)
20676 __pyx_t_5 = (__pyx_t_4 != 0);
20677 __pyx_t_2 = __pyx_t_5;
20678 __pyx_L4_bool_binop_done:;
20686 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 12, __pyx_L1_error)
20687 __Pyx_GOTREF(__pyx_t_6);
20688 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 12, __pyx_L1_error)
20689 __Pyx_GOTREF(__pyx_t_7);
20690 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20691 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20692 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20693 __PYX_ERR(0, 12, __pyx_L1_error)
20695 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 12, __pyx_L1_error)
20696 __Pyx_GOTREF(__pyx_t_6);
20698 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20699 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20700 if (likely(__pyx_t_8)) {
20701 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
20702 __Pyx_INCREF(__pyx_t_8);
20703 __Pyx_INCREF(
function);
20704 __Pyx_DECREF_SET(__pyx_t_7,
function);
20708 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
20709 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20710 __Pyx_GOTREF(__pyx_t_1);
20712 #if CYTHON_FAST_PYCALL 20713 if (PyFunction_Check(__pyx_t_7)) {
20714 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
20715 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
20716 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20717 __Pyx_GOTREF(__pyx_t_1);
20718 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20721 #if CYTHON_FAST_PYCCALL 20722 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
20723 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
20724 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
20725 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20726 __Pyx_GOTREF(__pyx_t_1);
20727 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20731 __pyx_t_9 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 12, __pyx_L1_error)
20732 __Pyx_GOTREF(__pyx_t_9);
20733 __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
20734 __Pyx_GIVEREF(__pyx_t_6);
20735 PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
20737 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
20738 __Pyx_GOTREF(__pyx_t_1);
20739 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20742 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20743 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20762 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20765 __Pyx_XDECREF(__pyx_t_1);
20766 __Pyx_XDECREF(__pyx_t_6);
20767 __Pyx_XDECREF(__pyx_t_7);
20768 __Pyx_XDECREF(__pyx_t_8);
20769 __Pyx_XDECREF(__pyx_t_9);
20770 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20773 __Pyx_XGIVEREF(__pyx_r);
20774 __Pyx_RefNannyFinishContext();
20778 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20779 struct __pyx_obj_18BoundaryConditions_BC_Base *p;
20781 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20782 o = (*t->tp_alloc)(t, 0);
20784 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20786 if (unlikely(!o))
return 0;
20787 p = ((
struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
20788 p->Shape = Py_None; Py_INCREF(Py_None);
20789 p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
20790 p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
20791 p->ct = Py_None; Py_INCREF(Py_None);
20792 p->_b_or.data = NULL;
20793 p->_b_or.memview = NULL;
20797 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
20798 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
20799 #if CYTHON_USE_TP_FINALIZE 20800 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20801 if (PyObject_CallFinalizerFromDealloc(o))
return;
20804 PyObject_GC_UnTrack(o);
20805 Py_CLEAR(p->Shape);
20807 Py_CLEAR(p->BC_type);
20809 __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
20810 (*Py_TYPE(o)->tp_free)(o);
20813 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc v,
void *a) {
20815 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
20817 e = (*v)(p->Shape, a);
if (e)
return e;
20820 e = (*v)(p->ct, a);
if (e)
return e;
20825 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
20827 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
20828 tmp = ((PyObject*)p->Shape);
20829 p->Shape = Py_None; Py_INCREF(Py_None);
20831 tmp = ((PyObject*)p->ct);
20832 p->ct = Py_None; Py_INCREF(Py_None);
20837 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED
void *x) {
20838 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
20841 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *v, CYTHON_UNUSED
void *x) {
20843 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o, v);
20846 PyErr_SetString(PyExc_NotImplementedError,
"__del__");
20851 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED
void *x) {
20852 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
20855 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *v, CYTHON_UNUSED
void *x) {
20857 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o, v);
20860 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
20864 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED
void *x) {
20865 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
20868 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *v, CYTHON_UNUSED
void *x) {
20870 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o, v);
20873 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
20877 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED
void *x) {
20878 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
20881 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *v, CYTHON_UNUSED
void *x) {
20883 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o, v);
20886 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
20890 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED
void *x) {
20891 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
20894 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *v, CYTHON_UNUSED
void *x) {
20896 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o, v);
20899 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
20903 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
20904 {
"getContext", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
20905 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, 0},
20906 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, 0},
20910 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
20911 {(
char *)
"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (
char *)0, 0},
20912 {(
char *)
"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (
char *)0, 0},
20913 {(
char *)
"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (
char *)0, 0},
20914 {(
char *)
"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (
char *)0, 0},
20915 {(
char *)
"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (
char *)0, 0},
20919 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
20920 PyVarObject_HEAD_INIT(0, 0)
20921 "BoundaryConditions.BC_Base",
20922 sizeof(
struct __pyx_obj_18BoundaryConditions_BC_Base),
20924 __pyx_tp_dealloc_18BoundaryConditions_BC_Base,
20928 #if PY_MAJOR_VERSION < 3
20931 #if PY_MAJOR_VERSION >= 3
20944 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
20945 "\n Generic class regrouping boundary conditions\n ",
20946 __pyx_tp_traverse_18BoundaryConditions_BC_Base,
20947 __pyx_tp_clear_18BoundaryConditions_BC_Base,
20952 __pyx_methods_18BoundaryConditions_BC_Base,
20954 __pyx_getsets_18BoundaryConditions_BC_Base,
20960 __pyx_pw_18BoundaryConditions_7BC_Base_1__init__,
20962 __pyx_tp_new_18BoundaryConditions_BC_Base,
20972 #if PY_VERSION_HEX >= 0x030400a1 20976 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
20978 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20979 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
20981 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20982 o = (*t->tp_alloc)(t, 0);
20984 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20986 if (unlikely(!o))
return 0;
20987 p = ((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
20988 p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
20989 p->uOfXT = Py_None; Py_INCREF(Py_None);
20993 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
20994 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
20995 #if CYTHON_USE_TP_FINALIZE 20996 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20997 if (PyObject_CallFinalizerFromDealloc(o))
return;
21000 PyObject_GC_UnTrack(o);
21001 Py_CLEAR(p->uOfXT);
21002 (*Py_TYPE(o)->tp_free)(o);
21005 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc v,
void *a) {
21007 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21009 e = (*v)(p->uOfXT, a);
if (e)
return e;
21014 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21016 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21017 tmp = ((PyObject*)p->uOfXT);
21018 p->uOfXT = Py_None; Py_INCREF(Py_None);
21023 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED
void *x) {
21024 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
21027 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *v, CYTHON_UNUSED
void *x) {
21029 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o, v);
21032 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
21036 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
21037 {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, 0},
21038 {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
21039 {
"setLinearBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, 0},
21040 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__, METH_NOARGS, 0},
21041 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__, METH_O, 0},
21045 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
21046 {(
char *)
"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (
char *)0, 0},
21050 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
21051 PyVarObject_HEAD_INIT(0, 0)
21052 "BoundaryConditions.BoundaryCondition",
21053 sizeof(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition),
21055 __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition,
21059 #if PY_MAJOR_VERSION < 3
21062 #if PY_MAJOR_VERSION >= 3
21075 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21076 "\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ",
21077 __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition,
21078 __pyx_tp_clear_18BoundaryConditions_BoundaryCondition,
21083 __pyx_methods_18BoundaryConditions_BoundaryCondition,
21085 __pyx_getsets_18BoundaryConditions_BoundaryCondition,
21091 __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__,
21093 __pyx_tp_new_18BoundaryConditions_BoundaryCondition,
21103 #if PY_VERSION_HEX >= 0x030400a1 21108 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
21109 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
21111 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21113 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21114 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
21115 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
21116 (void) PyObject_INIT(o, t);
21117 PyObject_GC_Track(o);
21119 o = (*t->tp_alloc)(t, 0);
21120 if (unlikely(!o))
return 0;
21125 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21126 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21127 PyObject_GC_UnTrack(o);
21128 Py_CLEAR(p->__pyx_v_value);
21129 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21130 __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
21132 (*Py_TYPE(o)->tp_free)(o);
21136 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc v,
void *a) {
21138 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21139 if (p->__pyx_v_value) {
21140 e = (*v)(p->__pyx_v_value, a);
if (e)
return e;
21145 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21147 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21148 tmp = ((PyObject*)p->__pyx_v_value);
21149 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21154 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
21155 PyVarObject_HEAD_INIT(0, 0)
21156 "BoundaryConditions.__pyx_scope_struct__setConstantBC",
21157 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC),
21159 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21163 #if PY_MAJOR_VERSION < 3
21166 #if PY_MAJOR_VERSION >= 3
21179 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
21181 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21182 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21197 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21207 #if PY_VERSION_HEX >= 0x030400a1 21212 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
21213 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
21215 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21217 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21218 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
21219 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
21220 (void) PyObject_INIT(o, t);
21221 PyObject_GC_Track(o);
21223 o = (*t->tp_alloc)(t, 0);
21224 if (unlikely(!o))
return 0;
21229 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21230 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21231 PyObject_GC_UnTrack(o);
21232 Py_CLEAR(p->__pyx_v_a0);
21233 Py_CLEAR(p->__pyx_v_a1);
21234 Py_CLEAR(p->__pyx_v_i);
21235 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21236 __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
21238 (*Py_TYPE(o)->tp_free)(o);
21242 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc v,
void *a) {
21244 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21245 if (p->__pyx_v_a0) {
21246 e = (*v)(p->__pyx_v_a0, a);
if (e)
return e;
21248 if (p->__pyx_v_a1) {
21249 e = (*v)(p->__pyx_v_a1, a);
if (e)
return e;
21251 if (p->__pyx_v_i) {
21252 e = (*v)(p->__pyx_v_i, a);
if (e)
return e;
21257 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21259 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21260 tmp = ((PyObject*)p->__pyx_v_a0);
21261 p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
21263 tmp = ((PyObject*)p->__pyx_v_a1);
21264 p->__pyx_v_a1 = Py_None; Py_INCREF(Py_None);
21266 tmp = ((PyObject*)p->__pyx_v_i);
21267 p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
21272 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
21273 PyVarObject_HEAD_INIT(0, 0)
21274 "BoundaryConditions.__pyx_scope_struct_1_setLinearBC",
21275 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC),
21277 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21281 #if PY_MAJOR_VERSION < 3
21284 #if PY_MAJOR_VERSION >= 3
21297 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
21299 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21300 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21315 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21325 #if PY_VERSION_HEX >= 0x030400a1 21329 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21331 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21332 struct __pyx_array_obj *p;
21334 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21335 o = (*t->tp_alloc)(t, 0);
21337 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21339 if (unlikely(!o))
return 0;
21340 p = ((
struct __pyx_array_obj *)o);
21341 p->__pyx_vtab = __pyx_vtabptr_array;
21342 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21343 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21344 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
21347 Py_DECREF(o); o = 0;
21351 static void __pyx_tp_dealloc_array(PyObject *o) {
21352 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
21353 #if CYTHON_USE_TP_FINALIZE 21354 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21355 if (PyObject_CallFinalizerFromDealloc(o))
return;
21359 PyObject *etype, *eval, *etb;
21360 PyErr_Fetch(&etype, &eval, &etb);
21362 __pyx_array___dealloc__(o);
21364 PyErr_Restore(etype, eval, etb);
21367 Py_CLEAR(p->_format);
21368 (*Py_TYPE(o)->tp_free)(o);
21370 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21372 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21373 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21378 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21380 return __pyx_array___setitem__(o, i, v);
21383 PyErr_Format(PyExc_NotImplementedError,
21384 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21389 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21390 PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21391 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21393 v = __pyx_array___getattr__(o, n);
21398 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
21399 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21402 static PyMethodDef __pyx_methods_array[] = {
21403 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21404 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21405 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21409 static struct PyGetSetDef __pyx_getsets_array[] = {
21410 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
21414 static PySequenceMethods __pyx_tp_as_sequence_array = {
21415 __pyx_array___len__,
21418 __pyx_sq_item_array,
21427 static PyMappingMethods __pyx_tp_as_mapping_array = {
21428 __pyx_array___len__,
21429 __pyx_array___getitem__,
21430 __pyx_mp_ass_subscript_array,
21433 static PyBufferProcs __pyx_tp_as_buffer_array = {
21434 #if PY_MAJOR_VERSION < 3 21437 #if PY_MAJOR_VERSION < 3 21440 #if PY_MAJOR_VERSION < 3 21443 #if PY_MAJOR_VERSION < 3 21446 __pyx_array_getbuffer,
21450 static PyTypeObject __pyx_type___pyx_array = {
21451 PyVarObject_HEAD_INIT(0, 0)
21452 "BoundaryConditions.array",
21453 sizeof(
struct __pyx_array_obj),
21455 __pyx_tp_dealloc_array,
21459 #if PY_MAJOR_VERSION < 3
21462 #if PY_MAJOR_VERSION >= 3
21467 &__pyx_tp_as_sequence_array,
21468 &__pyx_tp_as_mapping_array,
21472 __pyx_tp_getattro_array,
21474 &__pyx_tp_as_buffer_array,
21475 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21483 __pyx_methods_array,
21485 __pyx_getsets_array,
21493 __pyx_tp_new_array,
21503 #if PY_VERSION_HEX >= 0x030400a1 21508 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21509 struct __pyx_MemviewEnum_obj *p;
21511 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21512 o = (*t->tp_alloc)(t, 0);
21514 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21516 if (unlikely(!o))
return 0;
21517 p = ((
struct __pyx_MemviewEnum_obj *)o);
21518 p->name = Py_None; Py_INCREF(Py_None);
21522 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21523 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21524 #if CYTHON_USE_TP_FINALIZE 21525 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21526 if (PyObject_CallFinalizerFromDealloc(o))
return;
21529 PyObject_GC_UnTrack(o);
21531 (*Py_TYPE(o)->tp_free)(o);
21534 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v,
void *a) {
21536 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21538 e = (*v)(p->name, a);
if (e)
return e;
21543 static int __pyx_tp_clear_Enum(PyObject *o) {
21545 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21546 tmp = ((PyObject*)p->name);
21547 p->name = Py_None; Py_INCREF(Py_None);
21552 static PyMethodDef __pyx_methods_Enum[] = {
21553 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21554 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21558 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21559 PyVarObject_HEAD_INIT(0, 0)
21560 "BoundaryConditions.Enum",
21561 sizeof(
struct __pyx_MemviewEnum_obj),
21563 __pyx_tp_dealloc_Enum,
21567 #if PY_MAJOR_VERSION < 3
21570 #if PY_MAJOR_VERSION >= 3
21573 __pyx_MemviewEnum___repr__,
21583 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21585 __pyx_tp_traverse_Enum,
21586 __pyx_tp_clear_Enum,
21591 __pyx_methods_Enum,
21599 __pyx_MemviewEnum___init__,
21611 #if PY_VERSION_HEX >= 0x030400a1 21615 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21617 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21618 struct __pyx_memoryview_obj *p;
21620 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21621 o = (*t->tp_alloc)(t, 0);
21623 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21625 if (unlikely(!o))
return 0;
21626 p = ((
struct __pyx_memoryview_obj *)o);
21627 p->__pyx_vtab = __pyx_vtabptr_memoryview;
21628 p->obj = Py_None; Py_INCREF(Py_None);
21629 p->_size = Py_None; Py_INCREF(Py_None);
21630 p->_array_interface = Py_None; Py_INCREF(Py_None);
21631 p->view.obj = NULL;
21632 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
21635 Py_DECREF(o); o = 0;
21639 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21640 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21641 #if CYTHON_USE_TP_FINALIZE 21642 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21643 if (PyObject_CallFinalizerFromDealloc(o))
return;
21646 PyObject_GC_UnTrack(o);
21648 PyObject *etype, *eval, *etb;
21649 PyErr_Fetch(&etype, &eval, &etb);
21651 __pyx_memoryview___dealloc__(o);
21653 PyErr_Restore(etype, eval, etb);
21656 Py_CLEAR(p->_size);
21657 Py_CLEAR(p->_array_interface);
21658 (*Py_TYPE(o)->tp_free)(o);
21661 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v,
void *a) {
21663 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21665 e = (*v)(p->obj, a);
if (e)
return e;
21668 e = (*v)(p->_size, a);
if (e)
return e;
21670 if (p->_array_interface) {
21671 e = (*v)(p->_array_interface, a);
if (e)
return e;
21674 e = (*v)(p->view.obj, a);
if (e)
return e;
21679 static int __pyx_tp_clear_memoryview(PyObject *o) {
21681 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21682 tmp = ((PyObject*)p->obj);
21683 p->obj = Py_None; Py_INCREF(Py_None);
21685 tmp = ((PyObject*)p->_size);
21686 p->_size = Py_None; Py_INCREF(Py_None);
21688 tmp = ((PyObject*)p->_array_interface);
21689 p->_array_interface = Py_None; Py_INCREF(Py_None);
21691 Py_CLEAR(p->view.obj);
21694 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21696 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21697 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21702 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21704 return __pyx_memoryview___setitem__(o, i, v);
21707 PyErr_Format(PyExc_NotImplementedError,
21708 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21713 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
21714 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21717 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
21718 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21721 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
21722 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21725 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
21726 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21729 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
21730 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21733 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
21734 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21737 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
21738 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21741 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
21742 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21745 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
21746 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21749 static PyMethodDef __pyx_methods_memoryview[] = {
21750 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21751 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21752 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21753 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21754 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21755 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21759 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21760 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
21761 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
21762 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
21763 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
21764 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
21765 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
21766 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
21767 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
21768 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
21772 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21773 __pyx_memoryview___len__,
21776 __pyx_sq_item_memoryview,
21785 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21786 __pyx_memoryview___len__,
21787 __pyx_memoryview___getitem__,
21788 __pyx_mp_ass_subscript_memoryview,
21791 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21792 #if PY_MAJOR_VERSION < 3 21795 #if PY_MAJOR_VERSION < 3 21798 #if PY_MAJOR_VERSION < 3 21801 #if PY_MAJOR_VERSION < 3 21804 __pyx_memoryview_getbuffer,
21808 static PyTypeObject __pyx_type___pyx_memoryview = {
21809 PyVarObject_HEAD_INIT(0, 0)
21810 "BoundaryConditions.memoryview",
21811 sizeof(
struct __pyx_memoryview_obj),
21813 __pyx_tp_dealloc_memoryview,
21817 #if PY_MAJOR_VERSION < 3
21820 #if PY_MAJOR_VERSION >= 3
21823 __pyx_memoryview___repr__,
21825 &__pyx_tp_as_sequence_memoryview,
21826 &__pyx_tp_as_mapping_memoryview,
21829 __pyx_memoryview___str__,
21832 &__pyx_tp_as_buffer_memoryview,
21833 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21835 __pyx_tp_traverse_memoryview,
21836 __pyx_tp_clear_memoryview,
21841 __pyx_methods_memoryview,
21843 __pyx_getsets_memoryview,
21851 __pyx_tp_new_memoryview,
21861 #if PY_VERSION_HEX >= 0x030400a1 21865 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21867 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21868 struct __pyx_memoryviewslice_obj *p;
21869 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21870 if (unlikely(!o))
return 0;
21871 p = ((
struct __pyx_memoryviewslice_obj *)o);
21872 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21873 p->from_object = Py_None; Py_INCREF(Py_None);
21874 p->from_slice.memview = NULL;
21878 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21879 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21880 #if CYTHON_USE_TP_FINALIZE 21881 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21882 if (PyObject_CallFinalizerFromDealloc(o))
return;
21885 PyObject_GC_UnTrack(o);
21887 PyObject *etype, *eval, *etb;
21888 PyErr_Fetch(&etype, &eval, &etb);
21890 __pyx_memoryviewslice___dealloc__(o);
21892 PyErr_Restore(etype, eval, etb);
21894 Py_CLEAR(p->from_object);
21895 PyObject_GC_Track(o);
21896 __pyx_tp_dealloc_memoryview(o);
21899 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v,
void *a) {
21901 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21902 e = __pyx_tp_traverse_memoryview(o, v, a);
if (e)
return e;
21903 if (p->from_object) {
21904 e = (*v)(p->from_object, a);
if (e)
return e;
21909 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21911 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21912 __pyx_tp_clear_memoryview(o);
21913 tmp = ((PyObject*)p->from_object);
21914 p->from_object = Py_None; Py_INCREF(Py_None);
21916 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21920 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
21921 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21924 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21925 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21926 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21930 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21931 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
21935 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21936 PyVarObject_HEAD_INIT(0, 0)
21937 "BoundaryConditions._memoryviewslice",
21938 sizeof(
struct __pyx_memoryviewslice_obj),
21940 __pyx_tp_dealloc__memoryviewslice,
21944 #if PY_MAJOR_VERSION < 3
21947 #if PY_MAJOR_VERSION >= 3
21950 #if CYTHON_COMPILING_IN_PYPY 21951 __pyx_memoryview___repr__,
21960 #if CYTHON_COMPILING_IN_PYPY 21961 __pyx_memoryview___str__,
21968 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21969 "Internal class for passing memoryview slices to Python",
21970 __pyx_tp_traverse__memoryviewslice,
21971 __pyx_tp_clear__memoryviewslice,
21976 __pyx_methods__memoryviewslice,
21978 __pyx_getsets__memoryviewslice,
21986 __pyx_tp_new__memoryviewslice,
21996 #if PY_VERSION_HEX >= 0x030400a1 22001 static PyMethodDef __pyx_methods[] = {
22005 #if PY_MAJOR_VERSION >= 3 22006 #if CYTHON_PEP489_MULTI_PHASE_INIT 22007 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22008 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module);
22009 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22010 {Py_mod_create, (
void*)__pyx_pymod_create},
22011 {Py_mod_exec, (
void*)__pyx_pymod_exec_BoundaryConditions},
22016 static struct PyModuleDef __pyx_moduledef = {
22017 PyModuleDef_HEAD_INIT,
22018 "BoundaryConditions",
22020 #if CYTHON_PEP489_MULTI_PHASE_INIT 22026 #if CYTHON_PEP489_MULTI_PHASE_INIT 22027 __pyx_moduledef_slots,
22037 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22038 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22039 {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython,
sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
22040 {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython,
sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
22041 {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext,
sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
22042 {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho,
sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
22043 {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt,
sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
22044 {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython,
sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
22045 {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC,
sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
22046 {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC,
sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
22047 {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC,
sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
22048 {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions,
sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
22049 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22050 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22051 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22052 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22053 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22054 {&__pyx_n_s_Context, __pyx_k_Context,
sizeof(__pyx_k_Context), 0, 0, 1, 1},
22055 {&__pyx_n_s_Domain, __pyx_k_Domain,
sizeof(__pyx_k_Domain), 0, 0, 1, 1},
22056 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22057 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22058 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22059 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22060 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22061 {&__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_k_Incompatible_checksums_s_vs_0x96,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0x96), 0, 0, 1, 0},
22062 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22063 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22064 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22065 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22066 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22067 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22068 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22069 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22070 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22071 {&__pyx_n_s_None, __pyx_k_None,
sizeof(__pyx_k_None), 0, 0, 1, 1},
22072 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
22073 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22074 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22075 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22076 {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC,
sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
22077 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22078 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22079 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22080 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22081 {&__pyx_n_s_a0, __pyx_k_a0,
sizeof(__pyx_k_a0), 0, 0, 1, 1},
22082 {&__pyx_n_s_a1, __pyx_k_a1,
sizeof(__pyx_k_a1), 0, 0, 1, 1},
22083 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22084 {&__pyx_n_s_b_i, __pyx_k_b_i,
sizeof(__pyx_k_b_i), 0, 0, 1, 1},
22085 {&__pyx_n_s_b_or, __pyx_k_b_or,
sizeof(__pyx_k_b_or), 0, 0, 1, 1},
22086 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
22087 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
22088 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
22089 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
22090 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22091 {&__pyx_n_s_context, __pyx_k_context,
sizeof(__pyx_k_context), 0, 0, 1, 1},
22092 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22093 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22094 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
22095 {&__pyx_n_s_dict_2, __pyx_k_dict_2,
sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
22096 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22097 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
22098 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22099 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
22100 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
22101 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
22102 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22103 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22104 {&__pyx_n_s_get, __pyx_k_get,
sizeof(__pyx_k_get), 0, 0, 1, 1},
22105 {&__pyx_n_s_getContext, __pyx_k_getContext,
sizeof(__pyx_k_getContext), 0, 0, 1, 1},
22106 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22107 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22108 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
22109 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
22110 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22111 {&__pyx_n_s_init_cython, __pyx_k_init_cython,
sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
22112 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22113 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22114 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22115 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
22116 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
22117 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22118 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22119 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
22120 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
22121 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
22122 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22123 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
22124 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22125 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22126 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22127 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
22128 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
22129 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22130 {&__pyx_n_s_proteus, __pyx_k_proteus,
sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22131 {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py,
sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
22132 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22133 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22134 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22135 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22136 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22137 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22138 {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base,
sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
22139 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22140 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22141 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22142 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22143 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22144 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22145 {&__pyx_n_s_resetBC, __pyx_k_resetBC,
sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
22146 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
22147 {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted,
sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
22148 {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC,
sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
22149 {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda,
sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
22150 {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC,
sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
22151 {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda,
sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
22152 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22153 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22154 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22155 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
22156 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
22157 {&__pyx_n_s_state, __pyx_k_state,
sizeof(__pyx_k_state), 0, 0, 1, 1},
22158 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
22159 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
22160 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22161 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22162 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22163 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22164 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
22165 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
22166 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22167 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22168 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22169 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22170 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22171 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
22172 {&__pyx_n_s_use_setstate, __pyx_k_use_setstate,
sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
22173 {&__pyx_n_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 1},
22174 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
22175 {0, 0, 0, 0, 0, 0, 0}
22177 static int __Pyx_InitCachedBuiltins(
void) {
22178 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
22179 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(3, 229, __pyx_L1_error)
22180 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(3, 242, __pyx_L1_error)
22181 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 810, __pyx_L1_error)
22182 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(3, 1000, __pyx_L1_error)
22183 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 147, __pyx_L1_error)
22184 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(0, 150, __pyx_L1_error)
22185 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(0, 399, __pyx_L1_error)
22186 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(0, 608, __pyx_L1_error)
22187 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 827, __pyx_L1_error)
22193 static int __Pyx_InitCachedConstants(
void) {
22194 __Pyx_RefNannyDeclarations
22195 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22203 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error)
22204 __Pyx_GOTREF(__pyx_tuple_);
22205 __Pyx_GIVEREF(__pyx_tuple_);
22212 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error)
22213 __Pyx_GOTREF(__pyx_tuple__2);
22214 __Pyx_GIVEREF(__pyx_tuple__2);
22223 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(3, 229, __pyx_L1_error)
22224 __Pyx_GOTREF(__pyx_tuple__3);
22225 __Pyx_GIVEREF(__pyx_tuple__3);
22234 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(3, 233, __pyx_L1_error)
22235 __Pyx_GOTREF(__pyx_tuple__4);
22236 __Pyx_GIVEREF(__pyx_tuple__4);
22245 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 263, __pyx_L1_error)
22246 __Pyx_GOTREF(__pyx_tuple__5);
22247 __Pyx_GIVEREF(__pyx_tuple__5);
22256 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(3, 810, __pyx_L1_error)
22257 __Pyx_GOTREF(__pyx_tuple__6);
22258 __Pyx_GIVEREF(__pyx_tuple__6);
22267 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 814, __pyx_L1_error)
22268 __Pyx_GOTREF(__pyx_tuple__7);
22269 __Pyx_GIVEREF(__pyx_tuple__7);
22278 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 834, __pyx_L1_error)
22279 __Pyx_GOTREF(__pyx_tuple__8);
22280 __Pyx_GIVEREF(__pyx_tuple__8);
22289 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 1000, __pyx_L1_error)
22290 __Pyx_GOTREF(__pyx_tuple__9);
22291 __Pyx_GIVEREF(__pyx_tuple__9);
22300 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 1006, __pyx_L1_error)
22301 __Pyx_GOTREF(__pyx_tuple__10);
22302 __Pyx_GIVEREF(__pyx_tuple__10);
22309 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 1012, __pyx_L1_error)
22310 __Pyx_GOTREF(__pyx_tuple__11);
22311 __Pyx_GIVEREF(__pyx_tuple__11);
22320 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 132, __pyx_L1_error)
22321 __Pyx_GOTREF(__pyx_tuple__12);
22322 __Pyx_GIVEREF(__pyx_tuple__12);
22331 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 135, __pyx_L1_error)
22332 __Pyx_GOTREF(__pyx_tuple__13);
22333 __Pyx_GIVEREF(__pyx_tuple__13);
22342 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_ASCII);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 138, __pyx_L1_error)
22343 __Pyx_GOTREF(__pyx_tuple__14);
22344 __Pyx_GIVEREF(__pyx_tuple__14);
22353 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 147, __pyx_L1_error)
22354 __Pyx_GOTREF(__pyx_tuple__15);
22355 __Pyx_GIVEREF(__pyx_tuple__15);
22364 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 175, __pyx_L1_error)
22365 __Pyx_GOTREF(__pyx_tuple__16);
22366 __Pyx_GIVEREF(__pyx_tuple__16);
22375 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 191, __pyx_L1_error)
22376 __Pyx_GOTREF(__pyx_tuple__17);
22377 __Pyx_GIVEREF(__pyx_tuple__17);
22385 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 2, __pyx_L1_error)
22386 __Pyx_GOTREF(__pyx_tuple__18);
22387 __Pyx_GIVEREF(__pyx_tuple__18);
22394 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 4, __pyx_L1_error)
22395 __Pyx_GOTREF(__pyx_tuple__19);
22396 __Pyx_GIVEREF(__pyx_tuple__19);
22405 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 413, __pyx_L1_error)
22406 __Pyx_GOTREF(__pyx_tuple__20);
22407 __Pyx_GIVEREF(__pyx_tuple__20);
22416 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 490, __pyx_L1_error)
22417 __Pyx_GOTREF(__pyx_tuple__21);
22418 __Pyx_GIVEREF(__pyx_tuple__21);
22427 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 515, __pyx_L1_error)
22428 __Pyx_GOTREF(__pyx_tuple__22);
22429 __Pyx_GIVEREF(__pyx_tuple__22);
22438 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 565, __pyx_L1_error)
22439 __Pyx_GOTREF(__pyx_tuple__23);
22440 __Pyx_GIVEREF(__pyx_tuple__23);
22449 __pyx_tuple__24 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 572, __pyx_L1_error)
22450 __Pyx_GOTREF(__pyx_tuple__24);
22451 __Pyx_INCREF(__pyx_int_neg_1);
22452 __Pyx_GIVEREF(__pyx_int_neg_1);
22453 PyTuple_SET_ITEM(__pyx_tuple__24, 0, __pyx_int_neg_1);
22454 __Pyx_GIVEREF(__pyx_tuple__24);
22462 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 2, __pyx_L1_error)
22463 __Pyx_GOTREF(__pyx_tuple__25);
22464 __Pyx_GIVEREF(__pyx_tuple__25);
22471 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 4, __pyx_L1_error)
22472 __Pyx_GOTREF(__pyx_tuple__26);
22473 __Pyx_GIVEREF(__pyx_tuple__26);
22482 __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__27)) __PYX_ERR(0, 677, __pyx_L1_error)
22483 __Pyx_GOTREF(__pyx_slice__27);
22484 __Pyx_GIVEREF(__pyx_slice__27);
22493 __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__28)) __PYX_ERR(0, 680, __pyx_L1_error)
22494 __Pyx_GOTREF(__pyx_slice__28);
22495 __Pyx_GIVEREF(__pyx_slice__28);
22504 __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__29)) __PYX_ERR(0, 691, __pyx_L1_error)
22505 __Pyx_GOTREF(__pyx_slice__29);
22506 __Pyx_GIVEREF(__pyx_slice__29);
22515 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 698, __pyx_L1_error)
22516 __Pyx_GOTREF(__pyx_tuple__30);
22517 __Pyx_GIVEREF(__pyx_tuple__30);
22525 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2, __pyx_L1_error)
22526 __Pyx_GOTREF(__pyx_tuple__31);
22527 __Pyx_GIVEREF(__pyx_tuple__31);
22534 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 4, __pyx_L1_error)
22535 __Pyx_GOTREF(__pyx_tuple__32);
22536 __Pyx_GIVEREF(__pyx_tuple__32);
22545 __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 41, __pyx_L1_error)
22546 __Pyx_GOTREF(__pyx_tuple__33);
22547 __Pyx_GIVEREF(__pyx_tuple__33);
22548 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_getContext, 41, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 41, __pyx_L1_error)
22555 __pyx_tuple__35 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_use_setstate, __pyx_n_s_state, __pyx_n_s_dict_2);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 1, __pyx_L1_error)
22556 __Pyx_GOTREF(__pyx_tuple__35);
22557 __Pyx_GIVEREF(__pyx_tuple__35);
22558 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 1, __pyx_L1_error)
22566 __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 14, __pyx_L1_error)
22567 __Pyx_GOTREF(__pyx_tuple__37);
22568 __Pyx_GIVEREF(__pyx_tuple__37);
22569 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 14, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 14, __pyx_L1_error)
22578 __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 70, __pyx_L1_error)
22579 __Pyx_GOTREF(__pyx_tuple__39);
22580 __Pyx_GIVEREF(__pyx_tuple__39);
22581 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 70, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 70, __pyx_L1_error)
22590 __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 73, __pyx_L1_error)
22591 __Pyx_GOTREF(__pyx_tuple__41);
22592 __Pyx_GIVEREF(__pyx_tuple__41);
22593 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_resetBC, 73, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(1, 73, __pyx_L1_error)
22602 __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 76, __pyx_L1_error)
22603 __Pyx_GOTREF(__pyx_tuple__43);
22604 __Pyx_GIVEREF(__pyx_tuple__43);
22605 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 76, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(1, 76, __pyx_L1_error)
22613 __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a1, __pyx_n_s_i);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 88, __pyx_L1_error)
22614 __Pyx_GOTREF(__pyx_tuple__45);
22615 __Pyx_GIVEREF(__pyx_tuple__45);
22616 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 88, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(1, 88, __pyx_L1_error)
22623 __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 1, __pyx_L1_error)
22624 __Pyx_GOTREF(__pyx_tuple__47);
22625 __Pyx_GIVEREF(__pyx_tuple__47);
22626 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 1, __pyx_L1_error)
22634 __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3, __pyx_L1_error)
22635 __Pyx_GOTREF(__pyx_tuple__49);
22636 __Pyx_GIVEREF(__pyx_tuple__49);
22637 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 3, __pyx_L1_error)
22644 __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 1, __pyx_L1_error)
22645 __Pyx_GOTREF(__pyx_tuple__51);
22646 __Pyx_GIVEREF(__pyx_tuple__51);
22647 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 1, __pyx_L1_error)
22656 __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 285, __pyx_L1_error)
22657 __Pyx_GOTREF(__pyx_tuple__53);
22658 __Pyx_GIVEREF(__pyx_tuple__53);
22667 __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 286, __pyx_L1_error)
22668 __Pyx_GOTREF(__pyx_tuple__54);
22669 __Pyx_GIVEREF(__pyx_tuple__54);
22678 __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 287, __pyx_L1_error)
22679 __Pyx_GOTREF(__pyx_tuple__55);
22680 __Pyx_GIVEREF(__pyx_tuple__55);
22689 __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 290, __pyx_L1_error)
22690 __Pyx_GOTREF(__pyx_tuple__56);
22691 __Pyx_GIVEREF(__pyx_tuple__56);
22700 __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 291, __pyx_L1_error)
22701 __Pyx_GOTREF(__pyx_tuple__57);
22702 __Pyx_GIVEREF(__pyx_tuple__57);
22709 __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 1, __pyx_L1_error)
22710 __Pyx_GOTREF(__pyx_tuple__58);
22711 __Pyx_GIVEREF(__pyx_tuple__58);
22712 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 1, __pyx_L1_error)
22713 __Pyx_RefNannyFinishContext();
22716 __Pyx_RefNannyFinishContext();
22720 static int __Pyx_InitGlobals(
void) {
22721 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
22722 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
22723 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error)
22724 __pyx_int_158231071 = PyInt_FromLong(158231071L);
if (unlikely(!__pyx_int_158231071)) __PYX_ERR(1, 1, __pyx_L1_error)
22725 __pyx_int_184977713 = PyInt_FromLong(184977713L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(1, 1, __pyx_L1_error)
22726 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error)
22732 static int __Pyx_modinit_global_init_code(
void);
22733 static int __Pyx_modinit_variable_export_code(
void);
22734 static int __Pyx_modinit_function_export_code(
void);
22735 static int __Pyx_modinit_type_init_code(
void);
22736 static int __Pyx_modinit_type_import_code(
void);
22737 static int __Pyx_modinit_variable_import_code(
void);
22738 static int __Pyx_modinit_function_import_code(
void);
22740 static int __Pyx_modinit_global_init_code(
void) {
22741 __Pyx_RefNannyDeclarations
22742 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
22744 generic = Py_None; Py_INCREF(Py_None);
22745 strided = Py_None; Py_INCREF(Py_None);
22746 indirect = Py_None; Py_INCREF(Py_None);
22747 contiguous = Py_None; Py_INCREF(Py_None);
22748 indirect_contiguous = Py_None; Py_INCREF(Py_None);
22749 __Pyx_RefNannyFinishContext();
22753 static int __Pyx_modinit_variable_export_code(
void) {
22754 __Pyx_RefNannyDeclarations
22755 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
22757 __Pyx_RefNannyFinishContext();
22761 static int __Pyx_modinit_function_export_code(
void) {
22762 __Pyx_RefNannyDeclarations
22763 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
22765 __Pyx_RefNannyFinishContext();
22769 static int __Pyx_modinit_type_init_code(
void) {
22770 __Pyx_RefNannyDeclarations
22771 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
22773 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
22774 __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
22775 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
22776 __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22778 if (PyObject_SetAttrString(__pyx_m,
"BC_Base", (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
22779 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
22780 __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
22781 __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
22782 __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
22783 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
22784 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
22785 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
22786 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22788 if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
22789 if (PyObject_SetAttrString(__pyx_m,
"BoundaryCondition", (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
22790 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
22791 __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
22792 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(1, 76, __pyx_L1_error)
22793 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
22794 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
22795 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
22797 __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
22798 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(1, 88, __pyx_L1_error)
22799 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
22800 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
22801 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
22803 __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
22804 __pyx_vtabptr_array = &__pyx_vtable_array;
22805 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
22806 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
22807 __pyx_type___pyx_array.tp_print = 0;
22808 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
22809 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
22810 __pyx_array_type = &__pyx_type___pyx_array;
22811 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
22812 __pyx_type___pyx_MemviewEnum.tp_print = 0;
22813 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22814 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22816 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
22817 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22818 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22819 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22820 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22821 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22822 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22823 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22824 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
22825 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22826 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
22827 __pyx_type___pyx_memoryview.tp_print = 0;
22828 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22829 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22831 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
22832 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
22833 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22834 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22835 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22836 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
22837 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22838 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22839 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
22840 __pyx_type___pyx_memoryviewslice.tp_print = 0;
22841 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22842 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22844 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
22845 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
22846 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22847 __Pyx_RefNannyFinishContext();
22850 __Pyx_RefNannyFinishContext();
22854 static int __Pyx_modinit_type_import_code(
void) {
22855 __Pyx_RefNannyDeclarations
22856 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
22858 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME,
"type",
22859 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
22860 sizeof(PyTypeObject),
22862 sizeof(PyHeapTypeObject),
22864 0);
if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 9, __pyx_L1_error)
22865 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(
"numpy",
"dtype",
sizeof(PyArray_Descr), 0);
if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 164, __pyx_L1_error)
22866 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(
"numpy",
"flatiter",
sizeof(PyArrayIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 186, __pyx_L1_error)
22867 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 190, __pyx_L1_error)
22868 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(
"numpy",
"ndarray",
sizeof(PyArrayObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 199, __pyx_L1_error)
22869 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(
"numpy",
"ufunc",
sizeof(PyUFuncObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 872, __pyx_L1_error)
22870 __Pyx_RefNannyFinishContext();
22873 __Pyx_RefNannyFinishContext();
22877 static int __Pyx_modinit_variable_import_code(
void) {
22878 __Pyx_RefNannyDeclarations
22879 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
22881 __Pyx_RefNannyFinishContext();
22885 static int __Pyx_modinit_function_import_code(
void) {
22886 __Pyx_RefNannyDeclarations
22887 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
22889 __Pyx_RefNannyFinishContext();
22894 #if PY_MAJOR_VERSION < 3 22895 #ifdef CYTHON_NO_PYINIT_EXPORT 22896 #define __Pyx_PyMODINIT_FUNC void 22898 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 22901 #ifdef CYTHON_NO_PYINIT_EXPORT 22902 #define __Pyx_PyMODINIT_FUNC PyObject * 22904 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 22907 #ifndef CYTHON_SMALL_CODE 22908 #if defined(__clang__) 22909 #define CYTHON_SMALL_CODE 22910 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) 22911 #define CYTHON_SMALL_CODE __attribute__((cold)) 22913 #define CYTHON_SMALL_CODE 22918 #if PY_MAJOR_VERSION < 3 22919 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void) CYTHON_SMALL_CODE;
22920 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void)
22922 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void) CYTHON_SMALL_CODE;
22923 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void)
22924 #if CYTHON_PEP489_MULTI_PHASE_INIT 22926 return PyModuleDef_Init(&__pyx_moduledef);
22928 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name) {
22929 PyObject *value = PyObject_GetAttrString(spec, from_name);
22931 if (likely(value)) {
22932 result = PyDict_SetItemString(moddict, to_name, value);
22934 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22941 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22942 PyObject *module = NULL, *moddict, *modname;
22944 return __Pyx_NewRef(__pyx_m);
22945 modname = PyObject_GetAttrString(spec,
"name");
22946 if (unlikely(!modname))
goto bad;
22947 module = PyModule_NewObject(modname);
22948 Py_DECREF(modname);
22949 if (unlikely(!module))
goto bad;
22950 moddict = PyModule_GetDict(module);
22951 if (unlikely(!moddict))
goto bad;
22952 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__") < 0))
goto bad;
22953 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__") < 0))
goto bad;
22954 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__") < 0))
goto bad;
22955 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__") < 0))
goto bad;
22958 Py_XDECREF(module);
22963 static int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
22967 PyObject *__pyx_t_1 = NULL;
22968 static PyThread_type_lock __pyx_t_2[8];
22969 __Pyx_RefNannyDeclarations
22970 #if CYTHON_PEP489_MULTI_PHASE_INIT 22971 if (__pyx_m && __pyx_m == __pyx_pyinit_module)
return 0;
22972 #elif PY_MAJOR_VERSION >= 3 22973 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
22975 #if CYTHON_REFNANNY 22976 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
22977 if (!__Pyx_RefNanny) {
22979 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
22980 if (!__Pyx_RefNanny)
22981 Py_FatalError(
"failed to import 'refnanny' module");
22984 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
22985 if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22986 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
22987 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
22988 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
22989 #ifdef __Pyx_CyFunction_USED 22990 if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22992 #ifdef __Pyx_FusedFunction_USED 22993 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22995 #ifdef __Pyx_Coroutine_USED 22996 if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22998 #ifdef __Pyx_Generator_USED 22999 if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23001 #ifdef __Pyx_AsyncGen_USED 23002 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23004 #ifdef __Pyx_StopAsyncIteration_USED 23005 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23009 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 23011 PyEval_InitThreads();
23015 #if CYTHON_PEP489_MULTI_PHASE_INIT 23016 __pyx_m = __pyx_pyinit_module;
23017 Py_INCREF(__pyx_m);
23019 #if PY_MAJOR_VERSION < 3 23020 __pyx_m = Py_InitModule4(
"BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23022 __pyx_m = PyModule_Create(&__pyx_moduledef);
23024 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
23026 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
23027 Py_INCREF(__pyx_d);
23028 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
23029 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
23030 #if CYTHON_COMPILING_IN_PYPY 23031 Py_INCREF(__pyx_b);
23033 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
23035 if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23036 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 23037 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23039 if (__pyx_module_is_main_BoundaryConditions) {
23040 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23042 #if PY_MAJOR_VERSION >= 3 23044 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
23045 if (!PyDict_GetItemString(modules,
"BoundaryConditions")) {
23046 if (unlikely(PyDict_SetItemString(modules,
"BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
23051 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23053 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23055 (void)__Pyx_modinit_global_init_code();
23056 (void)__Pyx_modinit_variable_export_code();
23057 (void)__Pyx_modinit_function_export_code();
23058 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
23059 if (unlikely(__Pyx_modinit_type_import_code() != 0))
goto __pyx_L1_error;
23060 (void)__Pyx_modinit_variable_import_code();
23061 (void)__Pyx_modinit_function_import_code();
23063 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23064 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23074 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__34));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error)
23075 __Pyx_GOTREF(__pyx_t_1);
23076 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(1, 41, __pyx_L1_error)
23077 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23078 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23085 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__36));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23086 __Pyx_GOTREF(__pyx_t_1);
23087 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23088 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23096 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__38));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
23097 __Pyx_GOTREF(__pyx_t_1);
23098 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
23099 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23108 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__40));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error)
23109 __Pyx_GOTREF(__pyx_t_1);
23110 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(1, 70, __pyx_L1_error)
23111 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23112 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23121 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__42));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
23122 __Pyx_GOTREF(__pyx_t_1);
23123 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(1, 73, __pyx_L1_error)
23124 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23125 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23134 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__44));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 76, __pyx_L1_error)
23135 __Pyx_GOTREF(__pyx_t_1);
23136 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(1, 76, __pyx_L1_error)
23137 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23138 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23146 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__46));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error)
23147 __Pyx_GOTREF(__pyx_t_1);
23148 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(1, 88, __pyx_L1_error)
23149 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23150 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23157 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__48));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23158 __Pyx_GOTREF(__pyx_t_1);
23159 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23160 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23168 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__50));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
23169 __Pyx_GOTREF(__pyx_t_1);
23170 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
23171 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23178 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__52));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23179 __Pyx_GOTREF(__pyx_t_1);
23180 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23181 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23188 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23189 __Pyx_GOTREF(__pyx_t_1);
23190 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23191 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23200 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
23201 __Pyx_GOTREF(__pyx_t_1);
23202 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
23203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23204 PyType_Modified(__pyx_array_type);
23213 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
23214 __Pyx_GOTREF(__pyx_t_1);
23215 __Pyx_XGOTREF(
generic);
23216 __Pyx_DECREF_SET(
generic, __pyx_t_1);
23217 __Pyx_GIVEREF(__pyx_t_1);
23227 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
23228 __Pyx_GOTREF(__pyx_t_1);
23229 __Pyx_XGOTREF(strided);
23230 __Pyx_DECREF_SET(strided, __pyx_t_1);
23231 __Pyx_GIVEREF(__pyx_t_1);
23241 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
23242 __Pyx_GOTREF(__pyx_t_1);
23243 __Pyx_XGOTREF(indirect);
23244 __Pyx_DECREF_SET(indirect, __pyx_t_1);
23245 __Pyx_GIVEREF(__pyx_t_1);
23255 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
23256 __Pyx_GOTREF(__pyx_t_1);
23257 __Pyx_XGOTREF(contiguous);
23258 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23259 __Pyx_GIVEREF(__pyx_t_1);
23269 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
23270 __Pyx_GOTREF(__pyx_t_1);
23271 __Pyx_XGOTREF(indirect_contiguous);
23272 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23273 __Pyx_GIVEREF(__pyx_t_1);
23283 __pyx_memoryview_thread_locks_used = 0;
23292 __pyx_t_2[0] = PyThread_allocate_lock();
23293 __pyx_t_2[1] = PyThread_allocate_lock();
23294 __pyx_t_2[2] = PyThread_allocate_lock();
23295 __pyx_t_2[3] = PyThread_allocate_lock();
23296 __pyx_t_2[4] = PyThread_allocate_lock();
23297 __pyx_t_2[5] = PyThread_allocate_lock();
23298 __pyx_t_2[6] = PyThread_allocate_lock();
23299 __pyx_t_2[7] = PyThread_allocate_lock();
23300 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23309 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
23310 __Pyx_GOTREF(__pyx_t_1);
23311 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
23312 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23313 PyType_Modified(__pyx_memoryview_type);
23322 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error)
23323 __Pyx_GOTREF(__pyx_t_1);
23324 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 990, __pyx_L1_error)
23325 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23326 PyType_Modified(__pyx_memoryviewslice_type);
23333 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23334 __Pyx_GOTREF(__pyx_t_1);
23335 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23336 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23350 __Pyx_XDECREF(__pyx_t_1);
23353 __Pyx_AddTraceback(
"init BoundaryConditions", 0, __pyx_lineno, __pyx_filename);
23355 Py_DECREF(__pyx_m); __pyx_m = 0;
23356 }
else if (!PyErr_Occurred()) {
23357 PyErr_SetString(PyExc_ImportError,
"init BoundaryConditions");
23360 __Pyx_RefNannyFinishContext();
23361 #if CYTHON_PEP489_MULTI_PHASE_INIT 23362 return (__pyx_m != NULL) ? 0 : -1;
23363 #elif PY_MAJOR_VERSION >= 3 23372 #if CYTHON_REFNANNY 23373 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23374 PyObject *m = NULL, *p = NULL;
23376 m = PyImport_ImportModule((
char *)modname);
23378 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
23380 r = PyLong_AsVoidPtr(p);
23384 return (__Pyx_RefNannyAPIStruct *)r;
23389 #if CYTHON_USE_TYPE_SLOTS 23390 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23391 PyTypeObject* tp = Py_TYPE(obj);
23392 if (likely(tp->tp_getattro))
23393 return tp->tp_getattro(obj, attr_name);
23394 #if PY_MAJOR_VERSION < 3 23395 if (likely(tp->tp_getattr))
23396 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23398 return PyObject_GetAttr(obj, attr_name);
23403 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23404 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23405 if (unlikely(!result)) {
23406 PyErr_Format(PyExc_NameError,
23407 #
if PY_MAJOR_VERSION >= 3
23408 "name '%U' is not defined", name);
23410 "name '%.200s' is not defined", PyString_AS_STRING(name));
23417 static void __Pyx_RaiseDoubleKeywordsError(
23418 const char* func_name,
23421 PyErr_Format(PyExc_TypeError,
23422 #
if PY_MAJOR_VERSION >= 3
23423 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23425 "%s() got multiple values for keyword argument '%s'", func_name,
23426 PyString_AsString(kw_name));
23431 static int __Pyx_ParseOptionalKeywords(
23433 PyObject **argnames[],
23435 PyObject *values[],
23436 Py_ssize_t num_pos_args,
23437 const char* function_name)
23439 PyObject *key = 0, *value = 0;
23440 Py_ssize_t pos = 0;
23442 PyObject*** first_kw_arg = argnames + num_pos_args;
23443 while (PyDict_Next(kwds, &pos, &key, &value)) {
23444 name = first_kw_arg;
23445 while (*name && (**name != key)) name++;
23447 values[name-argnames] = value;
23450 name = first_kw_arg;
23451 #if PY_MAJOR_VERSION < 3 23452 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
23454 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23455 && _PyString_Eq(**name, key)) {
23456 values[name-argnames] = value;
23461 if (*name)
continue;
23463 PyObject*** argname = argnames;
23464 while (argname != first_kw_arg) {
23465 if ((**argname == key) || (
23466 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23467 && _PyString_Eq(**argname, key))) {
23468 goto arg_passed_twice;
23475 if (likely(PyUnicode_Check(key))) {
23477 int cmp = (**name == key) ? 0 :
23478 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23479 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
23481 PyUnicode_Compare(**name, key);
23482 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23484 values[name-argnames] = value;
23489 if (*name)
continue;
23491 PyObject*** argname = argnames;
23492 while (argname != first_kw_arg) {
23493 int cmp = (**argname == key) ? 0 :
23494 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23495 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
23497 PyUnicode_Compare(**argname, key);
23498 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23499 if (cmp == 0)
goto arg_passed_twice;
23504 goto invalid_keyword_type;
23506 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
23508 goto invalid_keyword;
23513 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23515 invalid_keyword_type:
23516 PyErr_Format(PyExc_TypeError,
23517 "%.200s() keywords must be strings", function_name);
23520 PyErr_Format(PyExc_TypeError,
23521 #
if PY_MAJOR_VERSION < 3
23522 "%.200s() got an unexpected keyword argument '%.200s'",
23523 function_name, PyString_AsString(key));
23525 "%s() got an unexpected keyword argument '%U'",
23526 function_name, key);
23533 static void __Pyx_RaiseArgtupleInvalid(
23534 const char* func_name,
23536 Py_ssize_t num_min,
23537 Py_ssize_t num_max,
23538 Py_ssize_t num_found)
23540 Py_ssize_t num_expected;
23541 const char *more_or_less;
23542 if (num_found < num_min) {
23543 num_expected = num_min;
23544 more_or_less =
"at least";
23546 num_expected = num_max;
23547 more_or_less =
"at most";
23550 more_or_less =
"exactly";
23552 PyErr_Format(PyExc_TypeError,
23553 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
23554 func_name, more_or_less, num_expected,
23555 (num_expected == 1) ?
"" :
"s", num_found);
23559 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
23561 if (!j)
return NULL;
23562 r = PyObject_GetItem(o, j);
23566 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
23567 CYTHON_NCP_UNUSED
int wraparound,
23568 CYTHON_NCP_UNUSED
int boundscheck) {
23569 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 23570 Py_ssize_t wrapped_i = i;
23571 if (wraparound & unlikely(i < 0)) {
23572 wrapped_i += PyList_GET_SIZE(o);
23574 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
23575 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
23579 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23581 return PySequence_GetItem(o, i);
23584 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
23585 CYTHON_NCP_UNUSED
int wraparound,
23586 CYTHON_NCP_UNUSED
int boundscheck) {
23587 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 23588 Py_ssize_t wrapped_i = i;
23589 if (wraparound & unlikely(i < 0)) {
23590 wrapped_i += PyTuple_GET_SIZE(o);
23592 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
23593 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
23597 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23599 return PySequence_GetItem(o, i);
23602 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
23603 CYTHON_NCP_UNUSED
int wraparound,
23604 CYTHON_NCP_UNUSED
int boundscheck) {
23605 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 23606 if (is_list || PyList_CheckExact(o)) {
23607 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
23608 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
23609 PyObject *r = PyList_GET_ITEM(o, n);
23614 else if (PyTuple_CheckExact(o)) {
23615 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
23616 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
23617 PyObject *r = PyTuple_GET_ITEM(o, n);
23622 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
23623 if (likely(m && m->sq_item)) {
23624 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
23625 Py_ssize_t l = m->sq_length(o);
23626 if (likely(l >= 0)) {
23629 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23634 return m->sq_item(o, i);
23638 if (is_list || PySequence_Check(o)) {
23639 return PySequence_GetItem(o, i);
23642 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23646 #if CYTHON_USE_TYPE_SLOTS 23647 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
23649 Py_ssize_t key_value;
23650 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
23651 if (unlikely(!(m && m->sq_item))) {
23652 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
23655 key_value = __Pyx_PyIndex_AsSsize_t(index);
23656 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
23657 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
23659 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
23661 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
23665 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
23666 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
23667 if (likely(m && m->mp_subscript)) {
23668 return m->mp_subscript(obj, key);
23670 return __Pyx_PyObject_GetIndex(obj, key);
23676 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
23678 __Pyx_memviewslice *memviewslice,
23679 int memview_is_new_reference)
23681 __Pyx_RefNannyDeclarations
23683 Py_buffer *buf = &memview->view;
23684 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
23686 PyErr_SetString(PyExc_ValueError,
23689 }
else if (memviewslice->memview || memviewslice->data) {
23690 PyErr_SetString(PyExc_ValueError,
23691 "memviewslice is already initialized!");
23694 if (buf->strides) {
23695 for (i = 0; i < ndim; i++) {
23696 memviewslice->strides[i] = buf->strides[i];
23699 Py_ssize_t stride = buf->itemsize;
23700 for (i = ndim - 1; i >= 0; i--) {
23701 memviewslice->strides[i] = stride;
23702 stride *= buf->shape[i];
23705 for (i = 0; i < ndim; i++) {
23706 memviewslice->shape[i] = buf->shape[i];
23707 if (buf->suboffsets) {
23708 memviewslice->suboffsets[i] = buf->suboffsets[i];
23710 memviewslice->suboffsets[i] = -1;
23713 memviewslice->memview = memview;
23714 memviewslice->data = (
char *)buf->buf;
23715 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
23716 Py_INCREF(memview);
23721 memviewslice->memview = 0;
23722 memviewslice->data = 0;
23725 __Pyx_RefNannyFinishContext();
23728 #ifndef Py_NO_RETURN 23729 #define Py_NO_RETURN 23731 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
23734 #ifdef HAVE_STDARG_PROTOTYPES 23735 va_start(vargs, fmt);
23739 vsnprintf(msg, 200, fmt, vargs);
23741 Py_FatalError(msg);
23743 static CYTHON_INLINE
int 23744 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23745 PyThread_type_lock lock)
23748 PyThread_acquire_lock(lock, 1);
23749 result = (*acquisition_count)++;
23750 PyThread_release_lock(lock);
23753 static CYTHON_INLINE
int 23754 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23755 PyThread_type_lock lock)
23758 PyThread_acquire_lock(lock, 1);
23759 result = (*acquisition_count)--;
23760 PyThread_release_lock(lock);
23763 static CYTHON_INLINE
void 23764 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
23767 struct __pyx_memoryview_obj *memview = memslice->memview;
23768 if (!memview || (PyObject *) memview == Py_None)
23770 if (__pyx_get_slice_count(memview) < 0)
23771 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
23772 __pyx_get_slice_count(memview), lineno);
23773 first_time = __pyx_add_acquisition_count(memview) == 0;
23776 Py_INCREF((PyObject *) memview);
23778 PyGILState_STATE _gilstate = PyGILState_Ensure();
23779 Py_INCREF((PyObject *) memview);
23780 PyGILState_Release(_gilstate);
23784 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
23785 int have_gil,
int lineno) {
23787 struct __pyx_memoryview_obj *memview = memslice->memview;
23790 }
else if ((PyObject *) memview == Py_None) {
23791 memslice->memview = NULL;
23794 if (__pyx_get_slice_count(memview) <= 0)
23795 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
23796 __pyx_get_slice_count(memview), lineno);
23797 last_time = __pyx_sub_acquisition_count(memview) == 1;
23798 memslice->data = NULL;
23801 Py_CLEAR(memslice->memview);
23803 PyGILState_STATE _gilstate = PyGILState_Ensure();
23804 Py_CLEAR(memslice->memview);
23805 PyGILState_Release(_gilstate);
23808 memslice->memview = NULL;
23813 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
23814 PyObject *empty_list = 0;
23815 PyObject *module = 0;
23816 PyObject *global_dict = 0;
23817 PyObject *empty_dict = 0;
23819 #if PY_MAJOR_VERSION < 3 23820 PyObject *py_import;
23821 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
23828 empty_list = PyList_New(0);
23833 global_dict = PyModule_GetDict(__pyx_m);
23836 empty_dict = PyDict_New();
23840 #if PY_MAJOR_VERSION >= 3 23842 if (strchr(__Pyx_MODULE_NAME,
'.')) {
23843 module = PyImport_ImportModuleLevelObject(
23844 name, global_dict, empty_dict, list, 1);
23846 if (!PyErr_ExceptionMatches(PyExc_ImportError))
23855 #if PY_MAJOR_VERSION < 3 23856 PyObject *py_level = PyInt_FromLong(level);
23859 module = PyObject_CallFunctionObjArgs(py_import,
23860 name, global_dict, empty_dict, list, py_level, NULL);
23861 Py_DECREF(py_level);
23863 module = PyImport_ImportModuleLevelObject(
23864 name, global_dict, empty_dict, list, level);
23869 #if PY_MAJOR_VERSION < 3 23870 Py_XDECREF(py_import);
23872 Py_XDECREF(empty_list);
23873 Py_XDECREF(empty_dict);
23878 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
23879 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
23880 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
23881 PyErr_Format(PyExc_ImportError,
23882 #
if PY_MAJOR_VERSION < 3
23883 "cannot import name %.230s", PyString_AS_STRING(name));
23885 "cannot import name %S", name);
23892 #if CYTHON_FAST_PYCCALL 23893 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23894 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23895 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23896 PyObject *
self = PyCFunction_GET_SELF(func);
23897 int flags = PyCFunction_GET_FLAGS(func);
23898 assert(PyCFunction_Check(func));
23899 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
23900 assert(nargs >= 0);
23901 assert(nargs == 0 || args != NULL);
23905 assert(!PyErr_Occurred());
23906 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23907 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (
self, args, nargs, NULL);
23909 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args, nargs);
23915 #if CYTHON_FAST_PYCALL 23916 #include "frameobject.h" 23917 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23918 PyObject *globals) {
23920 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23921 PyObject **fastlocals;
23924 assert(globals != NULL);
23929 assert(tstate != NULL);
23930 f = PyFrame_New(tstate, co, globals, NULL);
23934 fastlocals = f->f_localsplus;
23935 for (i = 0; i < na; i++) {
23937 fastlocals[i] = *args++;
23939 result = PyEval_EvalFrameEx(f,0);
23940 ++tstate->recursion_depth;
23942 --tstate->recursion_depth;
23945 #if 1 || PY_VERSION_HEX < 0x030600B1 23946 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
23947 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
23948 PyObject *globals = PyFunction_GET_GLOBALS(func);
23949 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
23951 #if PY_MAJOR_VERSION >= 3 23954 PyObject *kwtuple, **k;
23959 assert(kwargs == NULL || PyDict_Check(kwargs));
23960 nk = kwargs ? PyDict_Size(kwargs) : 0;
23961 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
23965 #
if PY_MAJOR_VERSION >= 3
23966 co->co_kwonlyargcount == 0 &&
23968 likely(kwargs == NULL || nk == 0) &&
23969 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
23970 if (argdefs == NULL && co->co_argcount == nargs) {
23971 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
23974 else if (nargs == 0 && argdefs != NULL
23975 && co->co_argcount == Py_SIZE(argdefs)) {
23978 args = &PyTuple_GET_ITEM(argdefs, 0);
23979 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
23983 if (kwargs != NULL) {
23985 kwtuple = PyTuple_New(2 * nk);
23986 if (kwtuple == NULL) {
23990 k = &PyTuple_GET_ITEM(kwtuple, 0);
23992 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24003 closure = PyFunction_GET_CLOSURE(func);
24004 #if PY_MAJOR_VERSION >= 3 24005 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24007 if (argdefs != NULL) {
24008 d = &PyTuple_GET_ITEM(argdefs, 0);
24009 nd = Py_SIZE(argdefs);
24015 #if PY_MAJOR_VERSION >= 3 24016 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24019 d, (
int)nd, kwdefs, closure);
24021 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24024 d, (
int)nd, closure);
24026 Py_XDECREF(kwtuple);
24028 Py_LeaveRecursiveCall();
24035 #if CYTHON_COMPILING_IN_CPYTHON 24036 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24038 ternaryfunc call = func->ob_type->tp_call;
24039 if (unlikely(!call))
24040 return PyObject_Call(func, arg, kw);
24041 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24043 result = (*call)(func, arg, kw);
24044 Py_LeaveRecursiveCall();
24045 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24048 "NULL result without error in PyObject_Call");
24055 #if CYTHON_COMPILING_IN_CPYTHON 24056 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24057 PyObject *
self, *result;
24059 cfunc = PyCFunction_GET_FUNCTION(func);
24060 self = PyCFunction_GET_SELF(func);
24061 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24063 result = cfunc(
self, arg);
24064 Py_LeaveRecursiveCall();
24065 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24068 "NULL result without error in PyObject_Call");
24075 #if CYTHON_COMPILING_IN_CPYTHON 24076 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24078 PyObject *args = PyTuple_New(1);
24079 if (unlikely(!args))
return NULL;
24081 PyTuple_SET_ITEM(args, 0, arg);
24082 result = __Pyx_PyObject_Call(func, args, NULL);
24086 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24087 #if CYTHON_FAST_PYCALL 24088 if (PyFunction_Check(func)) {
24089 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24092 if (likely(PyCFunction_Check(func))) {
24093 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24094 return __Pyx_PyObject_CallMethO(func, arg);
24095 #if CYTHON_FAST_PYCCALL 24096 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24097 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24101 return __Pyx__PyObject_CallOneArg(func, arg);
24104 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24106 PyObject *args = PyTuple_Pack(1, arg);
24107 if (unlikely(!args))
return NULL;
24108 result = __Pyx_PyObject_Call(func, args, NULL);
24115 #if CYTHON_COMPILING_IN_CPYTHON 24116 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24117 #if CYTHON_FAST_PYCALL 24118 if (PyFunction_Check(func)) {
24119 return __Pyx_PyFunction_FastCall(func, NULL, 0);
24122 #ifdef __Pyx_CyFunction_USED 24123 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
24125 if (likely(PyCFunction_Check(func))) {
24127 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24128 return __Pyx_PyObject_CallMethO(func, NULL);
24131 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24136 #if CYTHON_FAST_THREAD_STATE 24137 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24139 n = PyTuple_GET_SIZE(tuple);
24140 #if PY_MAJOR_VERSION >= 3 24141 for (i=0; i<n; i++) {
24142 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24145 for (i=0; i<n; i++) {
24146 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24150 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24151 PyObject *exc_type = tstate->curexc_type;
24152 if (exc_type == err)
return 1;
24153 if (unlikely(!exc_type))
return 0;
24154 if (unlikely(PyTuple_Check(err)))
24155 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24156 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24161 #if CYTHON_FAST_THREAD_STATE 24162 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24163 PyObject *tmp_type, *tmp_value, *tmp_tb;
24164 tmp_type = tstate->curexc_type;
24165 tmp_value = tstate->curexc_value;
24166 tmp_tb = tstate->curexc_traceback;
24167 tstate->curexc_type = type;
24168 tstate->curexc_value = value;
24169 tstate->curexc_traceback = tb;
24170 Py_XDECREF(tmp_type);
24171 Py_XDECREF(tmp_value);
24172 Py_XDECREF(tmp_tb);
24174 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24175 *type = tstate->curexc_type;
24176 *value = tstate->curexc_value;
24177 *tb = tstate->curexc_traceback;
24178 tstate->curexc_type = 0;
24179 tstate->curexc_value = 0;
24180 tstate->curexc_traceback = 0;
24185 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24186 #if CYTHON_USE_TYPE_SLOTS 24187 #if PY_MAJOR_VERSION >= 3 24188 if (likely(PyUnicode_Check(n)))
24190 if (likely(PyString_Check(n)))
24192 return __Pyx_PyObject_GetAttrStr(o, n);
24194 return PyObject_GetAttr(o, n);
24198 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24199 __Pyx_PyThreadState_declare
24200 __Pyx_PyThreadState_assign
24201 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24203 __Pyx_PyErr_Clear();
24207 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24208 PyObject *r = __Pyx_GetAttr(o, n);
24209 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24213 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
24215 #if !CYTHON_AVOID_BORROWED_REFS 24216 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 24217 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24218 if (likely(result)) {
24220 }
else if (unlikely(PyErr_Occurred())) {
24224 result = PyDict_GetItem(__pyx_d, name);
24225 if (likely(result)) {
24230 result = PyObject_GetItem(__pyx_d, name);
24234 result = __Pyx_GetBuiltinName(name);
24240 static int __Pyx_CheckKeywordStrings(
24242 const char* function_name,
24246 Py_ssize_t pos = 0;
24247 #if CYTHON_COMPILING_IN_PYPY 24248 if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
24249 goto invalid_keyword;
24252 while (PyDict_Next(kwdict, &pos, &key, 0)) {
24253 #if PY_MAJOR_VERSION < 3 24254 if (unlikely(!PyString_Check(key)))
24256 if (unlikely(!PyUnicode_Check(key)))
24257 goto invalid_keyword_type;
24259 if ((!kw_allowed) && unlikely(key))
24260 goto invalid_keyword;
24262 invalid_keyword_type:
24263 PyErr_Format(PyExc_TypeError,
24264 "%.200s() keywords must be strings", function_name);
24268 PyErr_Format(PyExc_TypeError,
24269 #
if PY_MAJOR_VERSION < 3
24270 "%.200s() got an unexpected keyword argument '%.200s'",
24271 function_name, PyString_AsString(key));
24273 "%s() got an unexpected keyword argument '%U'",
24274 function_name, key);
24280 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
24281 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
24282 int full_traceback, CYTHON_UNUSED
int nogil) {
24283 PyObject *old_exc, *old_val, *old_tb;
24285 __Pyx_PyThreadState_declare
24287 PyGILState_STATE state;
24289 state = PyGILState_Ensure();
24291 else state = (PyGILState_STATE)-1;
24294 __Pyx_PyThreadState_assign
24295 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24296 if (full_traceback) {
24297 Py_XINCREF(old_exc);
24298 Py_XINCREF(old_val);
24299 Py_XINCREF(old_tb);
24300 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24303 #if PY_MAJOR_VERSION < 3 24304 ctx = PyString_FromString(name);
24306 ctx = PyUnicode_FromString(name);
24308 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24310 PyErr_WriteUnraisable(Py_None);
24312 PyErr_WriteUnraisable(ctx);
24317 PyGILState_Release(state);
24322 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname) {
24323 PyErr_Format(PyExc_NameError,
"free variable '%s' referenced before assignment in enclosing scope", varname);
24327 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
24328 PyObject* fake_module;
24329 PyTypeObject* cached_type = NULL;
24330 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
24331 if (!fake_module)
return NULL;
24332 Py_INCREF(fake_module);
24333 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
24335 if (!PyType_Check((PyObject*)cached_type)) {
24336 PyErr_Format(PyExc_TypeError,
24337 "Shared Cython type %.200s is not a type object",
24341 if (cached_type->tp_basicsize != type->tp_basicsize) {
24342 PyErr_Format(PyExc_TypeError,
24343 "Shared Cython type %.200s has the wrong size, try recompiling",
24348 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
24350 if (PyType_Ready(type) < 0)
goto bad;
24351 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
24354 cached_type = type;
24357 Py_DECREF(fake_module);
24358 return cached_type;
24360 Py_XDECREF(cached_type);
24361 cached_type = NULL;
24366 #include <structmember.h> 24368 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
24370 if (unlikely(op->func_doc == NULL)) {
24371 if (op->func.m_ml->ml_doc) {
24372 #if PY_MAJOR_VERSION >= 3 24373 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
24375 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
24377 if (unlikely(op->func_doc == NULL))
24380 Py_INCREF(Py_None);
24384 Py_INCREF(op->func_doc);
24385 return op->func_doc;
24388 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
24390 PyObject *tmp = op->func_doc;
24391 if (value == NULL) {
24395 op->func_doc = value;
24400 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
24402 if (unlikely(op->func_name == NULL)) {
24403 #if PY_MAJOR_VERSION >= 3 24404 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
24406 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
24408 if (unlikely(op->func_name == NULL))
24411 Py_INCREF(op->func_name);
24412 return op->func_name;
24415 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
24418 #if PY_MAJOR_VERSION >= 3 24419 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
24421 if (unlikely(value == NULL || !PyString_Check(value))) {
24423 PyErr_SetString(PyExc_TypeError,
24424 "__name__ must be set to a string object");
24427 tmp = op->func_name;
24429 op->func_name = value;
24434 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
24436 Py_INCREF(op->func_qualname);
24437 return op->func_qualname;
24440 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
24443 #if PY_MAJOR_VERSION >= 3 24444 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
24446 if (unlikely(value == NULL || !PyString_Check(value))) {
24448 PyErr_SetString(PyExc_TypeError,
24449 "__qualname__ must be set to a string object");
24452 tmp = op->func_qualname;
24454 op->func_qualname = value;
24459 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
24462 self = m->func_closure;
24469 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
24471 if (unlikely(op->func_dict == NULL)) {
24472 op->func_dict = PyDict_New();
24473 if (unlikely(op->func_dict == NULL))
24476 Py_INCREF(op->func_dict);
24477 return op->func_dict;
24480 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
24483 if (unlikely(value == NULL)) {
24484 PyErr_SetString(PyExc_TypeError,
24485 "function's dictionary may not be deleted");
24488 if (unlikely(!PyDict_Check(value))) {
24489 PyErr_SetString(PyExc_TypeError,
24490 "setting function's dictionary to a non-dict");
24493 tmp = op->func_dict;
24495 op->func_dict = value;
24500 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
24502 Py_INCREF(op->func_globals);
24503 return op->func_globals;
24506 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
24508 Py_INCREF(Py_None);
24512 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
24514 PyObject* result = (op->func_code) ? op->func_code : Py_None;
24519 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
24521 PyObject *res = op->defaults_getter((PyObject *) op);
24522 if (unlikely(!res))
24524 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 24525 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
24526 Py_INCREF(op->defaults_tuple);
24527 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
24528 Py_INCREF(op->defaults_kwdict);
24530 op->defaults_tuple = PySequence_ITEM(res, 0);
24531 if (unlikely(!op->defaults_tuple)) result = -1;
24533 op->defaults_kwdict = PySequence_ITEM(res, 1);
24534 if (unlikely(!op->defaults_kwdict)) result = -1;
24541 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
24545 }
else if (value != Py_None && !PyTuple_Check(value)) {
24546 PyErr_SetString(PyExc_TypeError,
24547 "__defaults__ must be set to a tuple object");
24551 tmp = op->defaults_tuple;
24552 op->defaults_tuple = value;
24557 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
24558 PyObject* result = op->defaults_tuple;
24559 if (unlikely(!result)) {
24560 if (op->defaults_getter) {
24561 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
24562 result = op->defaults_tuple;
24571 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
24575 }
else if (value != Py_None && !PyDict_Check(value)) {
24576 PyErr_SetString(PyExc_TypeError,
24577 "__kwdefaults__ must be set to a dict object");
24581 tmp = op->defaults_kwdict;
24582 op->defaults_kwdict = value;
24587 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
24588 PyObject* result = op->defaults_kwdict;
24589 if (unlikely(!result)) {
24590 if (op->defaults_getter) {
24591 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
24592 result = op->defaults_kwdict;
24601 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
24603 if (!value || value == Py_None) {
24605 }
else if (!PyDict_Check(value)) {
24606 PyErr_SetString(PyExc_TypeError,
24607 "__annotations__ must be set to a dict object");
24611 tmp = op->func_annotations;
24612 op->func_annotations = value;
24617 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
24618 PyObject* result = op->func_annotations;
24619 if (unlikely(!result)) {
24620 result = PyDict_New();
24621 if (unlikely(!result))
return NULL;
24622 op->func_annotations = result;
24627 static PyGetSetDef __pyx_CyFunction_getsets[] = {
24628 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
24629 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
24630 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
24631 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
24632 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
24633 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
24634 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
24635 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
24636 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
24637 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
24638 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
24639 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
24640 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
24641 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
24642 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
24643 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
24644 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
24645 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
24648 static PyMemberDef __pyx_CyFunction_members[] = {
24649 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
24653 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
24655 #if PY_MAJOR_VERSION >= 3 24656 return PyUnicode_FromString(m->func.m_ml->ml_name);
24658 return PyString_FromString(m->func.m_ml->ml_name);
24661 static PyMethodDef __pyx_CyFunction_methods[] = {
24662 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
24665 #if PY_VERSION_HEX < 0x030500A0 24666 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) 24668 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) 24670 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml,
int flags, PyObject* qualname,
24671 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
24672 __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
24676 __Pyx_CyFunction_weakreflist(op) = NULL;
24677 op->func.m_ml = ml;
24678 op->func.m_self = (PyObject *) op;
24679 Py_XINCREF(closure);
24680 op->func_closure = closure;
24681 Py_XINCREF(module);
24682 op->func.m_module = module;
24683 op->func_dict = NULL;
24684 op->func_name = NULL;
24685 Py_INCREF(qualname);
24686 op->func_qualname = qualname;
24687 op->func_doc = NULL;
24688 op->func_classobj = NULL;
24689 op->func_globals = globals;
24690 Py_INCREF(op->func_globals);
24692 op->func_code = code;
24693 op->defaults_pyobjects = 0;
24694 op->defaults = NULL;
24695 op->defaults_tuple = NULL;
24696 op->defaults_kwdict = NULL;
24697 op->defaults_getter = NULL;
24698 op->func_annotations = NULL;
24699 PyObject_GC_Track(op);
24700 return (PyObject *) op;
24703 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
24705 Py_CLEAR(m->func_closure);
24706 Py_CLEAR(m->func.m_module);
24707 Py_CLEAR(m->func_dict);
24708 Py_CLEAR(m->func_name);
24709 Py_CLEAR(m->func_qualname);
24710 Py_CLEAR(m->func_doc);
24711 Py_CLEAR(m->func_globals);
24712 Py_CLEAR(m->func_code);
24713 Py_CLEAR(m->func_classobj);
24714 Py_CLEAR(m->defaults_tuple);
24715 Py_CLEAR(m->defaults_kwdict);
24716 Py_CLEAR(m->func_annotations);
24718 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
24720 for (i = 0; i < m->defaults_pyobjects; i++)
24721 Py_XDECREF(pydefaults[i]);
24722 PyObject_Free(m->defaults);
24723 m->defaults = NULL;
24727 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
24729 if (__Pyx_CyFunction_weakreflist(m) != NULL)
24730 PyObject_ClearWeakRefs((PyObject *) m);
24731 __Pyx_CyFunction_clear(m);
24732 PyObject_GC_Del(m);
24734 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
24736 PyObject_GC_UnTrack(m);
24737 __Pyx__CyFunction_dealloc(m);
24739 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
24741 Py_VISIT(m->func_closure);
24742 Py_VISIT(m->func.m_module);
24743 Py_VISIT(m->func_dict);
24744 Py_VISIT(m->func_name);
24745 Py_VISIT(m->func_qualname);
24746 Py_VISIT(m->func_doc);
24747 Py_VISIT(m->func_globals);
24748 Py_VISIT(m->func_code);
24749 Py_VISIT(m->func_classobj);
24750 Py_VISIT(m->defaults_tuple);
24751 Py_VISIT(m->defaults_kwdict);
24753 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
24755 for (i = 0; i < m->defaults_pyobjects; i++)
24756 Py_VISIT(pydefaults[i]);
24760 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
24762 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
24763 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
24767 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
24769 type = (PyObject *)(Py_TYPE(obj));
24770 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
24772 if (obj == Py_None)
24774 return __Pyx_PyMethod_New(func, obj, type);
24777 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
24779 #if PY_MAJOR_VERSION >= 3 24780 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
24781 op->func_qualname, (
void *)op);
24783 return PyString_FromFormat(
"<cyfunction %s at %p>",
24784 PyString_AsString(op->func_qualname), (
void *)op);
24787 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
24788 PyCFunctionObject*
f = (PyCFunctionObject*)func;
24789 PyCFunction meth = f->m_ml->ml_meth;
24791 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
24793 if (likely(kw == NULL || PyDict_Size(kw) == 0))
24794 return (*meth)(
self, arg);
24796 case METH_VARARGS | METH_KEYWORDS:
24797 return (*(PyCFunctionWithKeywords)meth)(
self, arg, kw);
24799 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
24800 size = PyTuple_GET_SIZE(arg);
24801 if (likely(size == 0))
24802 return (*meth)(
self, NULL);
24803 PyErr_Format(PyExc_TypeError,
24804 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24805 f->m_ml->ml_name, size);
24810 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
24811 size = PyTuple_GET_SIZE(arg);
24812 if (likely(size == 1)) {
24813 PyObject *result, *arg0;
24814 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 24815 arg0 = PyTuple_GET_ITEM(arg, 0);
24817 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
24819 result = (*meth)(
self, arg0);
24820 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) 24825 PyErr_Format(PyExc_TypeError,
24826 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24827 f->m_ml->ml_name, size);
24832 PyErr_SetString(PyExc_SystemError,
"Bad call flags in " 24833 "__Pyx_CyFunction_Call. METH_OLDARGS is no " 24834 "longer supported!");
24837 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
24841 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24842 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
24844 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
24846 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
24847 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
24849 PyObject *new_args;
24851 argc = PyTuple_GET_SIZE(args);
24852 new_args = PyTuple_GetSlice(args, 1, argc);
24853 if (unlikely(!new_args))
24855 self = PyTuple_GetItem(args, 0);
24856 if (unlikely(!
self)) {
24857 Py_DECREF(new_args);
24860 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
24861 Py_DECREF(new_args);
24863 result = __Pyx_CyFunction_Call(func, args, kw);
24867 static PyTypeObject __pyx_CyFunctionType_type = {
24868 PyVarObject_HEAD_INIT(0, 0)
24869 "cython_function_or_method",
24870 sizeof(__pyx_CyFunctionObject),
24872 (destructor) __Pyx_CyFunction_dealloc,
24876 #if PY_MAJOR_VERSION < 3 24881 (reprfunc) __Pyx_CyFunction_repr,
24886 __Pyx_CyFunction_CallAsMethod,
24891 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
24893 (traverseproc) __Pyx_CyFunction_traverse,
24894 (inquiry) __Pyx_CyFunction_clear,
24896 #
if PY_VERSION_HEX < 0x030500A0
24897 offsetof(__pyx_CyFunctionObject, func_weakreflist),
24899 offsetof(PyCFunctionObject, m_weakreflist),
24903 __pyx_CyFunction_methods,
24904 __pyx_CyFunction_members,
24905 __pyx_CyFunction_getsets,
24908 __Pyx_CyFunction_descr_get,
24910 offsetof(__pyx_CyFunctionObject, func_dict),
24923 #if PY_VERSION_HEX >= 0x030400a1 24927 static int __pyx_CyFunction_init(
void) {
24928 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
24929 if (unlikely(__pyx_CyFunctionType == NULL)) {
24934 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
24935 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
24936 m->defaults = PyObject_Malloc(size);
24937 if (unlikely(!m->defaults))
24938 return PyErr_NoMemory();
24939 memset(m->defaults, 0, size);
24940 m->defaults_pyobjects = pyobjects;
24941 return m->defaults;
24943 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
24944 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
24945 m->defaults_tuple = tuple;
24948 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
24949 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
24950 m->defaults_kwdict = dict;
24953 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
24954 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
24955 m->func_annotations = dict;
24960 #if PY_MAJOR_VERSION < 3 24961 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24962 CYTHON_UNUSED PyObject *cause) {
24963 __Pyx_PyThreadState_declare
24965 if (!value || value == Py_None)
24969 if (!tb || tb == Py_None)
24973 if (!PyTraceBack_Check(tb)) {
24974 PyErr_SetString(PyExc_TypeError,
24975 "raise: arg 3 must be a traceback or None");
24979 if (PyType_Check(type)) {
24980 #if CYTHON_COMPILING_IN_PYPY 24982 Py_INCREF(Py_None);
24986 PyErr_NormalizeException(&type, &value, &tb);
24989 PyErr_SetString(PyExc_TypeError,
24990 "instance exception may not have a separate value");
24994 type = (PyObject*) Py_TYPE(type);
24996 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24997 PyErr_SetString(PyExc_TypeError,
24998 "raise: exception class must be a subclass of BaseException");
25002 __Pyx_PyThreadState_assign
25003 __Pyx_ErrRestore(type, value, tb);
25012 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25013 PyObject* owned_instance = NULL;
25014 if (tb == Py_None) {
25016 }
else if (tb && !PyTraceBack_Check(tb)) {
25017 PyErr_SetString(PyExc_TypeError,
25018 "raise: arg 3 must be a traceback or None");
25021 if (value == Py_None)
25023 if (PyExceptionInstance_Check(type)) {
25025 PyErr_SetString(PyExc_TypeError,
25026 "instance exception may not have a separate value");
25030 type = (PyObject*) Py_TYPE(value);
25031 }
else if (PyExceptionClass_Check(type)) {
25032 PyObject *instance_class = NULL;
25033 if (value && PyExceptionInstance_Check(value)) {
25034 instance_class = (PyObject*) Py_TYPE(value);
25035 if (instance_class != type) {
25036 int is_subclass = PyObject_IsSubclass(instance_class, type);
25037 if (!is_subclass) {
25038 instance_class = NULL;
25039 }
else if (unlikely(is_subclass == -1)) {
25042 type = instance_class;
25046 if (!instance_class) {
25049 args = PyTuple_New(0);
25050 else if (PyTuple_Check(value)) {
25054 args = PyTuple_Pack(1, value);
25057 owned_instance = PyObject_Call(type, args, NULL);
25059 if (!owned_instance)
25061 value = owned_instance;
25062 if (!PyExceptionInstance_Check(value)) {
25063 PyErr_Format(PyExc_TypeError,
25064 "calling %R should have returned an instance of " 25065 "BaseException, not %R",
25066 type, Py_TYPE(value));
25071 PyErr_SetString(PyExc_TypeError,
25072 "raise: exception class must be a subclass of BaseException");
25076 PyObject *fixed_cause;
25077 if (cause == Py_None) {
25078 fixed_cause = NULL;
25079 }
else if (PyExceptionClass_Check(cause)) {
25080 fixed_cause = PyObject_CallObject(cause, NULL);
25081 if (fixed_cause == NULL)
25083 }
else if (PyExceptionInstance_Check(cause)) {
25084 fixed_cause = cause;
25085 Py_INCREF(fixed_cause);
25087 PyErr_SetString(PyExc_TypeError,
25088 "exception causes must derive from " 25092 PyException_SetCause(value, fixed_cause);
25094 PyErr_SetObject(type, value);
25096 #if CYTHON_COMPILING_IN_PYPY 25097 PyObject *tmp_type, *tmp_value, *tmp_tb;
25098 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25100 PyErr_Restore(tmp_type, tmp_value, tb);
25101 Py_XDECREF(tmp_tb);
25103 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25104 PyObject* tmp_tb = tstate->curexc_traceback;
25105 if (tb != tmp_tb) {
25107 tstate->curexc_traceback = tb;
25108 Py_XDECREF(tmp_tb);
25113 Py_XDECREF(owned_instance);
25119 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25121 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25122 PyErr_SetString(PyExc_TypeError,
25123 "hasattr(): attribute name must be string");
25126 r = __Pyx_GetAttr(o, n);
25127 if (unlikely(!r)) {
25137 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY 25138 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
25140 value = PyDict_GetItemWithError(d, key);
25141 if (unlikely(!value)) {
25142 if (!PyErr_Occurred()) {
25143 PyObject* args = PyTuple_Pack(1, key);
25145 PyErr_SetObject(PyExc_KeyError, args);
25156 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25157 PyErr_Format(PyExc_ValueError,
25158 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
25162 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25163 PyErr_Format(PyExc_ValueError,
25164 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
25165 index, (index == 1) ?
"" :
"s");
25169 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
25170 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
25174 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25175 if (unlikely(!type)) {
25176 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25179 if (likely(__Pyx_TypeCheck(obj, type)))
25181 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
25182 Py_TYPE(obj)->tp_name, type->tp_name);
25187 #if CYTHON_FAST_THREAD_STATE 25188 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25189 #if PY_VERSION_HEX >= 0x030700A3 25190 *type = tstate->exc_state.exc_type;
25191 *value = tstate->exc_state.exc_value;
25192 *tb = tstate->exc_state.exc_traceback;
25194 *type = tstate->exc_type;
25195 *value = tstate->exc_value;
25196 *tb = tstate->exc_traceback;
25199 Py_XINCREF(*value);
25202 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25203 PyObject *tmp_type, *tmp_value, *tmp_tb;
25204 #if PY_VERSION_HEX >= 0x030700A3 25205 tmp_type = tstate->exc_state.exc_type;
25206 tmp_value = tstate->exc_state.exc_value;
25207 tmp_tb = tstate->exc_state.exc_traceback;
25208 tstate->exc_state.exc_type = type;
25209 tstate->exc_state.exc_value = value;
25210 tstate->exc_state.exc_traceback = tb;
25212 tmp_type = tstate->exc_type;
25213 tmp_value = tstate->exc_value;
25214 tmp_tb = tstate->exc_traceback;
25215 tstate->exc_type = type;
25216 tstate->exc_value = value;
25217 tstate->exc_traceback = tb;
25219 Py_XDECREF(tmp_type);
25220 Py_XDECREF(tmp_value);
25221 Py_XDECREF(tmp_tb);
25226 #if CYTHON_FAST_THREAD_STATE 25227 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25229 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
25231 PyObject *local_type, *local_value, *local_tb;
25232 #if CYTHON_FAST_THREAD_STATE 25233 PyObject *tmp_type, *tmp_value, *tmp_tb;
25234 local_type = tstate->curexc_type;
25235 local_value = tstate->curexc_value;
25236 local_tb = tstate->curexc_traceback;
25237 tstate->curexc_type = 0;
25238 tstate->curexc_value = 0;
25239 tstate->curexc_traceback = 0;
25241 PyErr_Fetch(&local_type, &local_value, &local_tb);
25243 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25244 #if CYTHON_FAST_THREAD_STATE 25245 if (unlikely(tstate->curexc_type))
25247 if (unlikely(PyErr_Occurred()))
25250 #if PY_MAJOR_VERSION >= 3 25252 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25256 Py_XINCREF(local_tb);
25257 Py_XINCREF(local_type);
25258 Py_XINCREF(local_value);
25259 *type = local_type;
25260 *value = local_value;
25262 #if CYTHON_FAST_THREAD_STATE 25263 #if PY_VERSION_HEX >= 0x030700A3 25264 tmp_type = tstate->exc_state.exc_type;
25265 tmp_value = tstate->exc_state.exc_value;
25266 tmp_tb = tstate->exc_state.exc_traceback;
25267 tstate->exc_state.exc_type = local_type;
25268 tstate->exc_state.exc_value = local_value;
25269 tstate->exc_state.exc_traceback = local_tb;
25271 tmp_type = tstate->exc_type;
25272 tmp_value = tstate->exc_value;
25273 tmp_tb = tstate->exc_traceback;
25274 tstate->exc_type = local_type;
25275 tstate->exc_value = local_value;
25276 tstate->exc_traceback = local_tb;
25278 Py_XDECREF(tmp_type);
25279 Py_XDECREF(tmp_value);
25280 Py_XDECREF(tmp_tb);
25282 PyErr_SetExcInfo(local_type, local_value, local_tb);
25289 Py_XDECREF(local_type);
25290 Py_XDECREF(local_value);
25291 Py_XDECREF(local_tb);
25296 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
25298 if (unlikely(!type)) {
25299 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25303 #if PY_MAJOR_VERSION == 2 25304 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
25308 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
25310 PyErr_Format(PyExc_TypeError,
25311 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
25312 name, type->tp_name, Py_TYPE(obj)->tp_name);
25317 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
25318 #if CYTHON_COMPILING_IN_PYPY 25319 return PyObject_RichCompareBool(s1, s2, equals);
25322 return (equals == Py_EQ);
25323 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25324 const char *ps1, *ps2;
25325 Py_ssize_t length = PyBytes_GET_SIZE(s1);
25326 if (length != PyBytes_GET_SIZE(s2))
25327 return (equals == Py_NE);
25328 ps1 = PyBytes_AS_STRING(s1);
25329 ps2 = PyBytes_AS_STRING(s2);
25330 if (ps1[0] != ps2[0]) {
25331 return (equals == Py_NE);
25332 }
else if (length == 1) {
25333 return (equals == Py_EQ);
25336 #if CYTHON_USE_UNICODE_INTERNALS 25337 Py_hash_t hash1, hash2;
25338 hash1 = ((PyBytesObject*)s1)->ob_shash;
25339 hash2 = ((PyBytesObject*)s2)->ob_shash;
25340 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25341 return (equals == Py_NE);
25344 result = memcmp(ps1, ps2, (
size_t)length);
25345 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25347 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25348 return (equals == Py_NE);
25349 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25350 return (equals == Py_NE);
25353 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25356 result = __Pyx_PyObject_IsTrue(py_result);
25357 Py_DECREF(py_result);
25364 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
25365 #if CYTHON_COMPILING_IN_PYPY 25366 return PyObject_RichCompareBool(s1, s2, equals);
25368 #if PY_MAJOR_VERSION < 3 25369 PyObject* owned_ref = NULL;
25371 int s1_is_unicode, s2_is_unicode;
25375 s1_is_unicode = PyUnicode_CheckExact(s1);
25376 s2_is_unicode = PyUnicode_CheckExact(s2);
25377 #if PY_MAJOR_VERSION < 3 25378 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25379 owned_ref = PyUnicode_FromObject(s2);
25380 if (unlikely(!owned_ref))
25384 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25385 owned_ref = PyUnicode_FromObject(s1);
25386 if (unlikely(!owned_ref))
25390 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25391 return __Pyx_PyBytes_Equals(s1, s2, equals);
25394 if (s1_is_unicode & s2_is_unicode) {
25397 void *data1, *data2;
25398 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25400 length = __Pyx_PyUnicode_GET_LENGTH(s1);
25401 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25404 #if CYTHON_USE_UNICODE_INTERNALS 25406 Py_hash_t hash1, hash2;
25407 #if CYTHON_PEP393_ENABLED 25408 hash1 = ((PyASCIIObject*)s1)->hash;
25409 hash2 = ((PyASCIIObject*)s2)->hash;
25411 hash1 = ((PyUnicodeObject*)s1)->hash;
25412 hash2 = ((PyUnicodeObject*)s2)->hash;
25414 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25419 kind = __Pyx_PyUnicode_KIND(s1);
25420 if (kind != __Pyx_PyUnicode_KIND(s2)) {
25423 data1 = __Pyx_PyUnicode_DATA(s1);
25424 data2 = __Pyx_PyUnicode_DATA(s2);
25425 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25427 }
else if (length == 1) {
25430 int result = memcmp(data1, data2, (
size_t)(length * kind));
25431 #if PY_MAJOR_VERSION < 3 25432 Py_XDECREF(owned_ref);
25434 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25436 }
else if ((s1 == Py_None) & s2_is_unicode) {
25438 }
else if ((s2 == Py_None) & s1_is_unicode) {
25442 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25443 #if PY_MAJOR_VERSION < 3 25444 Py_XDECREF(owned_ref);
25448 result = __Pyx_PyObject_IsTrue(py_result);
25449 Py_DECREF(py_result);
25453 #if PY_MAJOR_VERSION < 3 25454 Py_XDECREF(owned_ref);
25456 return (equals == Py_EQ);
25458 #if PY_MAJOR_VERSION < 3 25459 Py_XDECREF(owned_ref);
25461 return (equals == Py_NE);
25466 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25467 Py_ssize_t q = a / b;
25468 Py_ssize_t r = a - q*b;
25469 q -= ((r != 0) & ((r ^ b) < 0));
25474 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25475 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25476 const char* encoding,
const char* errors,
25477 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
25479 if (unlikely((start < 0) | (stop < 0))) {
25480 size_t slen = strlen(cstring);
25481 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
25482 PyErr_SetString(PyExc_OverflowError,
25483 "c-string too long to convert to Python");
25486 length = (Py_ssize_t) slen;
25495 length = stop - start;
25496 if (unlikely(length <= 0))
25497 return PyUnicode_FromUnicode(NULL, 0);
25500 return decode_func(cstring, length, errors);
25502 return PyUnicode_Decode(cstring, length, encoding, errors);
25507 #if CYTHON_FAST_THREAD_STATE 25508 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25509 PyObject *tmp_type, *tmp_value, *tmp_tb;
25510 #if PY_VERSION_HEX >= 0x030700A3 25511 tmp_type = tstate->exc_state.exc_type;
25512 tmp_value = tstate->exc_state.exc_value;
25513 tmp_tb = tstate->exc_state.exc_traceback;
25514 tstate->exc_state.exc_type = *type;
25515 tstate->exc_state.exc_value = *value;
25516 tstate->exc_state.exc_traceback = *tb;
25518 tmp_type = tstate->exc_type;
25519 tmp_value = tstate->exc_value;
25520 tmp_tb = tstate->exc_traceback;
25521 tstate->exc_type = *type;
25522 tstate->exc_value = *value;
25523 tstate->exc_traceback = *tb;
25526 *value = tmp_value;
25530 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25531 PyObject *tmp_type, *tmp_value, *tmp_tb;
25532 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25533 PyErr_SetExcInfo(*type, *value, *tb);
25535 *value = tmp_value;
25541 #if CYTHON_COMPILING_IN_CPYTHON 25542 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25548 return b == &PyBaseObject_Type;
25550 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25552 if (a == b)
return 1;
25556 n = PyTuple_GET_SIZE(mro);
25557 for (i = 0; i < n; i++) {
25558 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25563 return __Pyx_InBases(a, b);
25565 #if PY_MAJOR_VERSION == 2 25566 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25567 PyObject *exception, *value, *tb;
25569 __Pyx_PyThreadState_declare
25570 __Pyx_PyThreadState_assign
25571 __Pyx_ErrFetch(&exception, &value, &tb);
25572 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25573 if (unlikely(res == -1)) {
25574 PyErr_WriteUnraisable(err);
25578 res = PyObject_IsSubclass(err, exc_type2);
25579 if (unlikely(res == -1)) {
25580 PyErr_WriteUnraisable(err);
25584 __Pyx_ErrRestore(exception, value, tb);
25588 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25589 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25591 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25596 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25598 assert(PyExceptionClass_Check(exc_type));
25599 n = PyTuple_GET_SIZE(tuple);
25600 #if PY_MAJOR_VERSION >= 3 25601 for (i=0; i<n; i++) {
25602 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25605 for (i=0; i<n; i++) {
25606 PyObject *t = PyTuple_GET_ITEM(tuple, i);
25607 #if PY_MAJOR_VERSION < 3 25608 if (likely(exc_type == t))
return 1;
25610 if (likely(PyExceptionClass_Check(t))) {
25611 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
25617 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25618 if (likely(err == exc_type))
return 1;
25619 if (likely(PyExceptionClass_Check(err))) {
25620 if (likely(PyExceptionClass_Check(exc_type))) {
25621 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25622 }
else if (likely(PyTuple_Check(exc_type))) {
25623 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25627 return PyErr_GivenExceptionMatches(err, exc_type);
25629 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25630 assert(PyExceptionClass_Check(exc_type1));
25631 assert(PyExceptionClass_Check(exc_type2));
25632 if (likely(err == exc_type1 || err == exc_type2))
return 1;
25633 if (likely(PyExceptionClass_Check(err))) {
25634 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25636 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25641 #if !CYTHON_COMPILING_IN_PYPY 25642 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
25643 #if PY_MAJOR_VERSION < 3 25644 if (likely(PyInt_CheckExact(op1))) {
25645 const long b = intval;
25647 long a = PyInt_AS_LONG(op1);
25648 x = (long)((
unsigned long)a + b);
25649 if (likely((x^a) >= 0 || (x^b) >= 0))
25650 return PyInt_FromLong(x);
25651 return PyLong_Type.tp_as_number->nb_add(op1, op2);
25654 #if CYTHON_USE_PYLONG_INTERNALS 25655 if (likely(PyLong_CheckExact(op1))) {
25656 const long b = intval;
25658 #ifdef HAVE_LONG_LONG 25659 const PY_LONG_LONG llb = intval;
25660 PY_LONG_LONG lla, llx;
25662 const digit* digits = ((PyLongObject*)op1)->ob_digit;
25663 const Py_ssize_t size = Py_SIZE(op1);
25664 if (likely(__Pyx_sst_abs(size) <= 1)) {
25665 a = likely(size) ? digits[0] : 0;
25666 if (size == -1) a = -a;
25670 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25671 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25673 #ifdef HAVE_LONG_LONG 25674 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25675 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25679 CYTHON_FALLTHROUGH;
25681 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25682 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25684 #ifdef HAVE_LONG_LONG 25685 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25686 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25690 CYTHON_FALLTHROUGH;
25692 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25693 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25695 #ifdef HAVE_LONG_LONG 25696 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25697 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25701 CYTHON_FALLTHROUGH;
25703 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25704 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25706 #ifdef HAVE_LONG_LONG 25707 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25708 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25712 CYTHON_FALLTHROUGH;
25714 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25715 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25717 #ifdef HAVE_LONG_LONG 25718 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25719 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25723 CYTHON_FALLTHROUGH;
25725 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25726 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25728 #ifdef HAVE_LONG_LONG 25729 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25730 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25734 CYTHON_FALLTHROUGH;
25735 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
25739 return PyLong_FromLong(x);
25740 #ifdef HAVE_LONG_LONG 25743 return PyLong_FromLongLong(llx);
25749 if (PyFloat_CheckExact(op1)) {
25750 const long b = intval;
25751 double a = PyFloat_AS_DOUBLE(op1);
25753 PyFPE_START_PROTECT(
"add",
return NULL)
25754 result = ((double)a) + (double)b;
25755 PyFPE_END_PROTECT(result)
25756 return PyFloat_FromDouble(result);
25758 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25763 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
25764 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
25768 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
25771 q -= ((r != 0) & ((r ^ b) < 0));
25776 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 25777 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25778 PyErr_Format(PyExc_AttributeError,
25779 #
if PY_MAJOR_VERSION >= 3
25780 "'%.50s' object has no attribute '%U'",
25781 tp->tp_name, attr_name);
25783 "'%.50s' object has no attribute '%.400s'",
25784 tp->tp_name, PyString_AS_STRING(attr_name));
25788 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25790 PyTypeObject *tp = Py_TYPE(obj);
25791 if (unlikely(!PyString_Check(attr_name))) {
25792 return PyObject_GenericGetAttr(obj, attr_name);
25794 assert(!tp->tp_dictoffset);
25795 descr = _PyType_Lookup(tp, attr_name);
25796 if (unlikely(!descr)) {
25797 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25800 #if PY_MAJOR_VERSION < 3 25801 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25804 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
25806 PyObject *res =
f(descr, obj, (PyObject *)tp);
25816 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 25817 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25818 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25819 return PyObject_GenericGetAttr(obj, attr_name);
25821 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25826 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25828 PyObject *name_attr;
25829 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25830 if (likely(name_attr)) {
25831 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25835 if (unlikely(ret < 0)) {
25839 Py_XDECREF(name_attr);
25842 static int __Pyx_setup_reduce(PyObject* type_obj) {
25844 PyObject *object_reduce = NULL;
25845 PyObject *object_reduce_ex = NULL;
25846 PyObject *reduce = NULL;
25847 PyObject *reduce_ex = NULL;
25848 PyObject *reduce_cython = NULL;
25849 PyObject *setstate = NULL;
25850 PyObject *setstate_cython = NULL;
25851 #if CYTHON_USE_PYTYPE_LOOKUP 25852 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
25854 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
25856 #if CYTHON_USE_PYTYPE_LOOKUP 25857 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
25859 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
25861 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
25862 if (reduce_ex == object_reduce_ex) {
25863 #if CYTHON_USE_PYTYPE_LOOKUP 25864 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
25866 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
25868 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
25869 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25870 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
25871 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
25872 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
25873 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25874 if (!setstate) PyErr_Clear();
25875 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25876 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
25877 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
25878 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
25880 PyType_Modified((PyTypeObject*)type_obj);
25885 if (!PyErr_Occurred())
25886 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25889 #if !CYTHON_USE_PYTYPE_LOOKUP 25890 Py_XDECREF(object_reduce);
25891 Py_XDECREF(object_reduce_ex);
25893 Py_XDECREF(reduce);
25894 Py_XDECREF(reduce_ex);
25895 Py_XDECREF(reduce_cython);
25896 Py_XDECREF(setstate);
25897 Py_XDECREF(setstate_cython);
25902 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
25903 #if PY_VERSION_HEX >= 0x02070000 25904 PyObject *ob = PyCapsule_New(vtable, 0, 0);
25906 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25910 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25920 #ifndef CYTHON_CLINE_IN_TRACEBACK 25921 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
25922 PyObject *use_cline;
25923 PyObject *ptype, *pvalue, *ptraceback;
25924 #if CYTHON_COMPILING_IN_CPYTHON 25925 PyObject **cython_runtime_dict;
25927 if (unlikely(!__pyx_cython_runtime)) {
25930 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25931 #if CYTHON_COMPILING_IN_CPYTHON 25932 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25933 if (likely(cython_runtime_dict)) {
25934 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
25938 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25939 if (use_cline_obj) {
25940 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25941 Py_DECREF(use_cline_obj);
25949 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25951 else if (PyObject_Not(use_cline) != 0) {
25954 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25960 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
25961 int start = 0, mid = 0, end = count - 1;
25962 if (end >= 0 && code_line > entries[end].code_line) {
25965 while (start < end) {
25966 mid = start + (end - start) / 2;
25967 if (code_line < entries[mid].code_line) {
25969 }
else if (code_line > entries[mid].code_line) {
25975 if (code_line <= entries[mid].code_line) {
25981 static PyCodeObject *__pyx_find_code_object(
int code_line) {
25982 PyCodeObject* code_object;
25984 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25987 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25988 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25991 code_object = __pyx_code_cache.entries[pos].code_object;
25992 Py_INCREF(code_object);
25993 return code_object;
25995 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
25997 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25998 if (unlikely(!code_line)) {
26001 if (unlikely(!entries)) {
26002 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
26003 if (likely(entries)) {
26004 __pyx_code_cache.entries = entries;
26005 __pyx_code_cache.max_count = 64;
26006 __pyx_code_cache.count = 1;
26007 entries[0].code_line = code_line;
26008 entries[0].code_object = code_object;
26009 Py_INCREF(code_object);
26013 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26014 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26015 PyCodeObject* tmp = entries[pos].code_object;
26016 entries[pos].code_object = code_object;
26020 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26021 int new_max = __pyx_code_cache.max_count + 64;
26022 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26023 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
26024 if (unlikely(!entries)) {
26027 __pyx_code_cache.entries = entries;
26028 __pyx_code_cache.max_count = new_max;
26030 for (i=__pyx_code_cache.count; i>pos; i--) {
26031 entries[i] = entries[i-1];
26033 entries[pos].code_line = code_line;
26034 entries[pos].code_object = code_object;
26035 __pyx_code_cache.count++;
26036 Py_INCREF(code_object);
26040 #include "compile.h" 26041 #include "frameobject.h" 26042 #include "traceback.h" 26043 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26044 const char *funcname,
int c_line,
26045 int py_line,
const char *filename) {
26046 PyCodeObject *py_code = 0;
26047 PyObject *py_srcfile = 0;
26048 PyObject *py_funcname = 0;
26049 #if PY_MAJOR_VERSION < 3 26050 py_srcfile = PyString_FromString(filename);
26052 py_srcfile = PyUnicode_FromString(filename);
26054 if (!py_srcfile)
goto bad;
26056 #if PY_MAJOR_VERSION < 3 26057 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26059 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26063 #if PY_MAJOR_VERSION < 3 26064 py_funcname = PyString_FromString(funcname);
26066 py_funcname = PyUnicode_FromString(funcname);
26069 if (!py_funcname)
goto bad;
26070 py_code = __Pyx_PyCode_New(
26087 Py_DECREF(py_srcfile);
26088 Py_DECREF(py_funcname);
26091 Py_XDECREF(py_srcfile);
26092 Py_XDECREF(py_funcname);
26095 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
26096 int py_line,
const char *filename) {
26097 PyCodeObject *py_code = 0;
26098 PyFrameObject *py_frame = 0;
26099 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26101 c_line = __Pyx_CLineForTraceback(tstate, c_line);
26103 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26105 py_code = __Pyx_CreateCodeObjectForTraceback(
26106 funcname, c_line, py_line, filename);
26107 if (!py_code)
goto bad;
26108 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26110 py_frame = PyFrame_New(
26116 if (!py_frame)
goto bad;
26117 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26118 PyTraceBack_Here(py_frame);
26120 Py_XDECREF(py_code);
26121 Py_XDECREF(py_frame);
26124 #if PY_MAJOR_VERSION < 3 26125 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
26126 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
26127 if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray))
return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
26128 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
26129 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
26130 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26133 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26134 PyObject *obj = view->obj;
26136 if (PyObject_CheckBuffer(obj)) {
26137 PyBuffer_Release(view);
26141 else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
26150 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
26152 int i, index, step, start;
26153 Py_ssize_t itemsize = mvs.memview->view.itemsize;
26154 if (order ==
'F') {
26161 for (i = 0; i < ndim; i++) {
26162 index = start + step * i;
26163 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26165 itemsize *= mvs.shape[index];
26172 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26173 void **out_start,
void **out_end,
26174 int ndim,
size_t itemsize)
26178 start = end = slice->data;
26179 for (i = 0; i < ndim; i++) {
26180 Py_ssize_t stride = slice->strides[i];
26181 Py_ssize_t extent = slice->shape[i];
26183 *out_start = *out_end = start;
26187 end += stride * (extent - 1);
26189 start += stride * (extent - 1);
26192 *out_start = start;
26193 *out_end = end + itemsize;
26196 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26197 __Pyx_memviewslice *slice2,
26198 int ndim,
size_t itemsize)
26200 void *start1, *end1, *start2, *end2;
26201 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26202 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26203 return (start1 < end2) && (start2 < end1);
26207 static CYTHON_INLINE PyObject *
26208 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
26211 #if PY_VERSION_HEX >= 0x02070000 26212 cobj = PyCapsule_New(p, sig, NULL);
26214 cobj = PyCObject_FromVoidPtr(p, NULL);
26220 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp) {
26221 return (PyObject *) PyFloat_FromDouble(*(
double *) itemp);
26223 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj) {
26224 double value = __pyx_PyFloat_AsDouble(obj);
26225 if ((value == (
double)-1) && PyErr_Occurred())
26227 *(
double *) itemp = value;
26232 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
26238 S.u32 = 0x01020304;
26239 return S.u8[0] == 4;
26243 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26244 __Pyx_BufFmt_StackElem* stack,
26245 __Pyx_TypeInfo* type) {
26246 stack[0].field = &ctx->root;
26247 stack[0].parent_offset = 0;
26248 ctx->root.type = type;
26249 ctx->root.name =
"buffer dtype";
26250 ctx->root.offset = 0;
26252 ctx->head->field = &ctx->root;
26253 ctx->fmt_offset = 0;
26254 ctx->head->parent_offset = 0;
26255 ctx->new_packmode =
'@';
26256 ctx->enc_packmode =
'@';
26257 ctx->new_count = 1;
26258 ctx->enc_count = 0;
26260 ctx->is_complex = 0;
26261 ctx->is_valid_array = 0;
26262 ctx->struct_alignment = 0;
26263 while (type->typegroup ==
'S') {
26265 ctx->head->field = type->fields;
26266 ctx->head->parent_offset = 0;
26267 type = type->fields->type;
26270 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
26272 const char* t = *ts;
26273 if (*t < '0' || *t >
'9') {
26276 count = *t++ -
'0';
26277 while (*t >=
'0' && *t <
'9') {
26279 count += *t++ -
'0';
26285 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
26286 int number = __Pyx_BufFmt_ParseNumber(ts);
26288 PyErr_Format(PyExc_ValueError,\
26289 "Does not understand character buffer dtype format string ('%c')", **ts);
26292 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
26293 PyErr_Format(PyExc_ValueError,
26294 "Unexpected format string character: '%c'", ch);
26296 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
26298 case 'c':
return "'char'";
26299 case 'b':
return "'signed char'";
26300 case 'B':
return "'unsigned char'";
26301 case 'h':
return "'short'";
26302 case 'H':
return "'unsigned short'";
26303 case 'i':
return "'int'";
26304 case 'I':
return "'unsigned int'";
26305 case 'l':
return "'long'";
26306 case 'L':
return "'unsigned long'";
26307 case 'q':
return "'long long'";
26308 case 'Q':
return "'unsigned long long'";
26309 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
26310 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
26311 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
26312 case 'T':
return "a struct";
26313 case 'O':
return "Python object";
26314 case 'P':
return "a pointer";
26315 case 's':
case 'p':
return "a string";
26316 case 0:
return "end";
26317 default:
return "unparseable format string";
26320 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
26322 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26323 case 'h':
case 'H':
return 2;
26324 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
26325 case 'q':
case 'Q':
return 8;
26326 case 'f':
return (is_complex ? 8 : 4);
26327 case 'd':
return (is_complex ? 16 : 8);
26329 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
26332 case 'O':
case 'P':
return sizeof(
void*);
26334 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26338 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
26340 case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26341 case 'h':
case 'H':
return sizeof(short);
26342 case 'i':
case 'I':
return sizeof(int);
26343 case 'l':
case 'L':
return sizeof(long);
26344 #ifdef HAVE_LONG_LONG 26345 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
26347 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
26348 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
26349 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
26350 case 'O':
case 'P':
return sizeof(
void*);
26352 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26357 typedef struct {
char c;
short x; } __Pyx_st_short;
26358 typedef struct {
char c;
int x; } __Pyx_st_int;
26359 typedef struct {
char c;
long x; } __Pyx_st_long;
26360 typedef struct {
char c;
float x; } __Pyx_st_float;
26361 typedef struct {
char c;
double x; } __Pyx_st_double;
26362 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
26363 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
26364 #ifdef HAVE_LONG_LONG 26365 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26367 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
26369 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26370 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
26371 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
26372 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
26373 #ifdef HAVE_LONG_LONG 26374 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
26376 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
26377 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
26378 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
26379 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
26381 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26389 typedef struct {
short x;
char c; } __Pyx_pad_short;
26390 typedef struct {
int x;
char c; } __Pyx_pad_int;
26391 typedef struct {
long x;
char c; } __Pyx_pad_long;
26392 typedef struct {
float x;
char c; } __Pyx_pad_float;
26393 typedef struct {
double x;
char c; } __Pyx_pad_double;
26394 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
26395 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
26396 #ifdef HAVE_LONG_LONG 26397 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
26399 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
26401 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26402 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
26403 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
26404 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
26405 #ifdef HAVE_LONG_LONG 26406 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
26408 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
26409 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
26410 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
26411 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
26413 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26417 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
26421 case 'b':
case 'h':
case 'i':
26422 case 'l':
case 'q':
case 's':
case 'p':
26424 case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
26426 case 'f':
case 'd':
case 'g':
26427 return (is_complex ?
'C' :
'R');
26433 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26438 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26439 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26440 const char* expected;
26442 if (ctx->head == NULL) {
26446 expected = ctx->head->field->type->name;
26449 PyErr_Format(PyExc_ValueError,
26450 "Buffer dtype mismatch, expected %s%s%s but got %s",
26451 quote, expected, quote,
26452 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26454 __Pyx_StructField* field = ctx->head->field;
26455 __Pyx_StructField* parent = (ctx->head - 1)->field;
26456 PyErr_Format(PyExc_ValueError,
26457 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26458 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26459 parent->type->name, field->name);
26462 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26464 size_t size, offset, arraysize = 1;
26465 if (ctx->enc_type == 0)
return 0;
26466 if (ctx->head->field->type->arraysize[0]) {
26468 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
26469 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26471 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
26472 PyErr_Format(PyExc_ValueError,
26473 "Expected a dimension of size %zu, got %zu",
26474 ctx->head->field->type->arraysize[0], ctx->enc_count);
26478 if (!ctx->is_valid_array) {
26479 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
26480 ctx->head->field->type->ndim, ndim);
26483 for (i = 0; i < ctx->head->field->type->ndim; i++) {
26484 arraysize *= ctx->head->field->type->arraysize[i];
26486 ctx->is_valid_array = 0;
26487 ctx->enc_count = 1;
26489 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
26491 __Pyx_StructField* field = ctx->head->field;
26492 __Pyx_TypeInfo* type = field->type;
26493 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
26494 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
26496 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
26498 if (ctx->enc_packmode ==
'@') {
26499 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
26500 size_t align_mod_offset;
26501 if (align_at == 0)
return -1;
26502 align_mod_offset = ctx->fmt_offset % align_at;
26503 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
26504 if (ctx->struct_alignment == 0)
26505 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
26508 if (type->size != size || type->typegroup != group) {
26509 if (type->typegroup ==
'C' && type->fields != NULL) {
26510 size_t parent_offset = ctx->head->parent_offset + field->offset;
26512 ctx->head->field = type->fields;
26513 ctx->head->parent_offset = parent_offset;
26516 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
26518 __Pyx_BufFmt_RaiseExpected(ctx);
26522 offset = ctx->head->parent_offset + field->offset;
26523 if (ctx->fmt_offset != offset) {
26524 PyErr_Format(PyExc_ValueError,
26525 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
26526 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
26529 ctx->fmt_offset += size;
26531 ctx->fmt_offset += (arraysize - 1) * size;
26534 if (field == &ctx->root) {
26536 if (ctx->enc_count != 0) {
26537 __Pyx_BufFmt_RaiseExpected(ctx);
26542 ctx->head->field = ++field;
26543 if (field->type == NULL) {
26545 field = ctx->head->field;
26547 }
else if (field->type->typegroup ==
'S') {
26548 size_t parent_offset = ctx->head->parent_offset + field->offset;
26549 if (field->type->fields->type == NULL)
continue;
26550 field = field->type->fields;
26552 ctx->head->field = field;
26553 ctx->head->parent_offset = parent_offset;
26559 }
while (ctx->enc_count);
26561 ctx->is_complex = 0;
26565 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
26567 const char *ts = *tsp;
26569 int ndim = ctx->head->field->type->ndim;
26572 if (ctx->new_count != 1) {
26573 PyErr_SetString(PyExc_ValueError,
26574 "Cannot handle repeated arrays in format string");
26577 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26578 while (*ts && *ts !=
')') {
26580 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
26583 number = __Pyx_BufFmt_ExpectNumber(&ts);
26584 if (number == -1)
return NULL;
26585 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
26586 return PyErr_Format(PyExc_ValueError,
26587 "Expected a dimension of size %zu, got %d",
26588 ctx->head->field->type->arraysize[i], number);
26589 if (*ts !=
',' && *ts !=
')')
26590 return PyErr_Format(PyExc_ValueError,
26591 "Expected a comma in format string, got '%c'", *ts);
26592 if (*ts ==
',') ts++;
26596 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
26597 ctx->head->field->type->ndim, i);
26599 PyErr_SetString(PyExc_ValueError,
26600 "Unexpected end of format string, expected ')'");
26603 ctx->is_valid_array = 1;
26604 ctx->new_count = 1;
26608 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
26613 if (ctx->enc_type != 0 && ctx->head == NULL) {
26614 __Pyx_BufFmt_RaiseExpected(ctx);
26617 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26618 if (ctx->head != NULL) {
26619 __Pyx_BufFmt_RaiseExpected(ctx);
26629 if (!__Pyx_Is_Little_Endian()) {
26630 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
26633 ctx->new_packmode =
'=';
26638 if (__Pyx_Is_Little_Endian()) {
26639 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
26642 ctx->new_packmode =
'=';
26648 ctx->new_packmode = *ts++;
26652 const char* ts_after_sub;
26653 size_t i, struct_count = ctx->new_count;
26654 size_t struct_alignment = ctx->struct_alignment;
26655 ctx->new_count = 1;
26658 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
26661 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26663 ctx->enc_count = 0;
26664 ctx->struct_alignment = 0;
26667 for (i = 0; i != struct_count; ++i) {
26668 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
26669 if (!ts_after_sub)
return NULL;
26672 if (struct_alignment) ctx->struct_alignment = struct_alignment;
26677 size_t alignment = ctx->struct_alignment;
26679 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26681 if (alignment && ctx->fmt_offset % alignment) {
26682 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
26687 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26688 ctx->fmt_offset += ctx->new_count;
26689 ctx->new_count = 1;
26690 ctx->enc_count = 0;
26692 ctx->enc_packmode = ctx->new_packmode;
26698 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
26699 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
26702 CYTHON_FALLTHROUGH;
26703 case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
26704 case 'l':
case 'L':
case 'q':
case 'Q':
26705 case 'f':
case 'd':
case 'g':
26706 case 'O':
case 'p':
26707 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
26708 ctx->enc_packmode == ctx->new_packmode) {
26709 ctx->enc_count += ctx->new_count;
26710 ctx->new_count = 1;
26715 CYTHON_FALLTHROUGH;
26717 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26718 ctx->enc_count = ctx->new_count;
26719 ctx->enc_packmode = ctx->new_packmode;
26720 ctx->enc_type = *ts;
26721 ctx->is_complex = got_Z;
26723 ctx->new_count = 1;
26728 while(*ts !=
':') ++ts;
26732 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
26736 int number = __Pyx_BufFmt_ExpectNumber(&ts);
26737 if (number == -1)
return NULL;
26738 ctx->new_count = (size_t)number;
26746 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
26753 if (a->size != b->size || a->typegroup != b->typegroup ||
26754 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
26755 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
26756 return a->size == b->size;
26762 for (i = 0; i < a->ndim; i++)
26763 if (a->arraysize[i] != b->arraysize[i])
26766 if (a->typegroup ==
'S') {
26767 if (a->flags != b->flags)
26769 if (a->fields || b->fields) {
26770 if (!(a->fields && b->fields))
26772 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
26773 __Pyx_StructField *field_a = a->fields + i;
26774 __Pyx_StructField *field_b = b->fields + i;
26775 if (field_a->offset != field_b->offset ||
26776 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
26779 return !a->fields[i].type && !b->fields[i].type;
26787 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
26789 if (buf->shape[dim] <= 1)
26791 if (buf->strides) {
26792 if (spec & __Pyx_MEMVIEW_CONTIG) {
26793 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
26794 if (buf->strides[dim] !=
sizeof(
void *)) {
26795 PyErr_Format(PyExc_ValueError,
26796 "Buffer is not indirectly contiguous " 26797 "in dimension %d.", dim);
26800 }
else if (buf->strides[dim] != buf->itemsize) {
26801 PyErr_SetString(PyExc_ValueError,
26802 "Buffer and memoryview are not contiguous " 26803 "in the same dimension.");
26807 if (spec & __Pyx_MEMVIEW_FOLLOW) {
26808 Py_ssize_t stride = buf->strides[dim];
26811 if (stride < buf->itemsize) {
26812 PyErr_SetString(PyExc_ValueError,
26813 "Buffer and memoryview are not contiguous " 26814 "in the same dimension.");
26819 if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
26820 PyErr_Format(PyExc_ValueError,
26821 "C-contiguous buffer is not contiguous in " 26822 "dimension %d", dim);
26824 }
else if (spec & (__Pyx_MEMVIEW_PTR)) {
26825 PyErr_Format(PyExc_ValueError,
26826 "C-contiguous buffer is not indirect in " 26827 "dimension %d", dim);
26829 }
else if (buf->suboffsets) {
26830 PyErr_SetString(PyExc_ValueError,
26831 "Buffer exposes suboffsets but no strides");
26840 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
26842 if (spec & __Pyx_MEMVIEW_DIRECT) {
26843 if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
26844 PyErr_Format(PyExc_ValueError,
26845 "Buffer not compatible with direct access " 26846 "in dimension %d.", dim);
26850 if (spec & __Pyx_MEMVIEW_PTR) {
26851 if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
26852 PyErr_Format(PyExc_ValueError,
26853 "Buffer is not indirectly accessible " 26854 "in dimension %d.", dim);
26863 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
26866 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
26867 Py_ssize_t stride = 1;
26868 for (i = 0; i < ndim; i++) {
26869 if (stride * buf->itemsize != buf->strides[i] &&
26872 PyErr_SetString(PyExc_ValueError,
26873 "Buffer not fortran contiguous.");
26876 stride = stride * buf->shape[i];
26878 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
26879 Py_ssize_t stride = 1;
26880 for (i = ndim - 1; i >- 1; i--) {
26881 if (stride * buf->itemsize != buf->strides[i] &&
26882 buf->shape[i] > 1) {
26883 PyErr_SetString(PyExc_ValueError,
26884 "Buffer not C contiguous.");
26887 stride = stride * buf->shape[i];
26894 static int __Pyx_ValidateAndInit_memviewslice(
26899 __Pyx_TypeInfo *dtype,
26900 __Pyx_BufFmt_StackElem stack[],
26901 __Pyx_memviewslice *memviewslice,
26902 PyObject *original_obj)
26904 struct __pyx_memoryview_obj *memview, *new_memview;
26905 __Pyx_RefNannyDeclarations
26907 int i, spec = 0, retval = -1;
26908 __Pyx_BufFmt_Context ctx;
26909 int from_memoryview = __pyx_memoryview_check(original_obj);
26910 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
26911 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
26912 original_obj)->typeinfo)) {
26913 memview = (
struct __pyx_memoryview_obj *) original_obj;
26914 new_memview = NULL;
26916 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26917 original_obj, buf_flags, 0, dtype);
26918 new_memview = memview;
26919 if (unlikely(!memview))
26922 buf = &memview->view;
26923 if (buf->ndim != ndim) {
26924 PyErr_Format(PyExc_ValueError,
26925 "Buffer has wrong number of dimensions (expected %d, got %d)",
26930 __Pyx_BufFmt_Init(&ctx, stack, dtype);
26931 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
26933 if ((
unsigned) buf->itemsize != dtype->size) {
26934 PyErr_Format(PyExc_ValueError,
26935 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) " 26936 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
26938 (buf->itemsize > 1) ?
"s" :
"",
26941 (dtype->size > 1) ?
"s" :
"");
26944 for (i = 0; i < ndim; i++) {
26945 spec = axes_specs[i];
26946 if (!__pyx_check_strides(buf, i, ndim, spec))
26948 if (!__pyx_check_suboffsets(buf, i, ndim, spec))
26951 if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
26953 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
26954 new_memview != NULL) == -1)) {
26960 Py_XDECREF(new_memview);
26963 __Pyx_RefNannyFinishContext();
26968 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
26969 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26970 __Pyx_BufFmt_StackElem stack[1];
26971 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26973 if (obj == Py_None) {
26974 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
26977 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26978 PyBUF_RECORDS_RO | writable_flag, 1,
26979 &__Pyx_TypeInfo_double, stack,
26981 if (unlikely(retcode == -1))
26985 result.memview = NULL;
26986 result.data = NULL;
26991 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
26992 const int neg_one = (int) -1, const_zero = (
int) 0;
26993 const int is_unsigned = neg_one > const_zero;
26995 if (
sizeof(
int) <
sizeof(long)) {
26996 return PyInt_FromLong((
long) value);
26997 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
26998 return PyLong_FromUnsignedLong((
unsigned long) value);
26999 #ifdef HAVE_LONG_LONG 27000 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27001 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27005 if (
sizeof(
int) <=
sizeof(
long)) {
27006 return PyInt_FromLong((
long) value);
27007 #ifdef HAVE_LONG_LONG 27008 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27009 return PyLong_FromLongLong((PY_LONG_LONG) value);
27014 int one = 1;
int little = (int)*(
unsigned char *)&one;
27015 unsigned char *bytes = (
unsigned char *)&value;
27016 return _PyLong_FromByteArray(bytes,
sizeof(
int),
27017 little, !is_unsigned);
27022 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 27023 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 27024 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 27025 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 27026 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 27028 func_type value = func_value;\ 27029 if (sizeof(target_type) < sizeof(func_type)) {\ 27030 if (unlikely(value != (func_type) (target_type) value)) {\ 27031 func_type zero = 0;\ 27032 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 27033 return (target_type) -1;\ 27034 if (is_unsigned && unlikely(value < zero))\ 27035 goto raise_neg_overflow;\ 27037 goto raise_overflow;\ 27040 return (target_type) value;\ 27044 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
27045 const long neg_one = (long) -1, const_zero = (
long) 0;
27046 const int is_unsigned = neg_one > const_zero;
27048 if (
sizeof(
long) <
sizeof(long)) {
27049 return PyInt_FromLong((
long) value);
27050 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27051 return PyLong_FromUnsignedLong((
unsigned long) value);
27052 #ifdef HAVE_LONG_LONG 27053 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27054 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27058 if (
sizeof(
long) <=
sizeof(
long)) {
27059 return PyInt_FromLong((
long) value);
27060 #ifdef HAVE_LONG_LONG 27061 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27062 return PyLong_FromLongLong((PY_LONG_LONG) value);
27067 int one = 1;
int little = (int)*(
unsigned char *)&one;
27068 unsigned char *bytes = (
unsigned char *)&value;
27069 return _PyLong_FromByteArray(bytes,
sizeof(
long),
27070 little, !is_unsigned);
27075 #if CYTHON_CCOMPLEX 27077 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27078 return ::std::complex< float >(x, y);
27081 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27082 return x + y*(__pyx_t_float_complex)_Complex_I;
27086 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27087 __pyx_t_float_complex z;
27095 #if CYTHON_CCOMPLEX 27097 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27098 return (a.real == b.real) && (a.imag == b.imag);
27100 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27101 __pyx_t_float_complex z;
27102 z.real = a.real + b.real;
27103 z.imag = a.imag + b.imag;
27106 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27107 __pyx_t_float_complex z;
27108 z.real = a.real - b.real;
27109 z.imag = a.imag - b.imag;
27112 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27113 __pyx_t_float_complex z;
27114 z.real = a.real * b.real - a.imag * b.imag;
27115 z.imag = a.real * b.imag + a.imag * b.real;
27119 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27121 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27122 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
27123 if (b.real == 0 && b.imag == 0) {
27124 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27126 float r = b.imag / b.real;
27127 float s = 1.0 / (b.real + b.imag * r);
27128 return __pyx_t_float_complex_from_parts(
27129 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27132 float r = b.real / b.imag;
27133 float s = 1.0 / (b.imag + b.real * r);
27134 return __pyx_t_float_complex_from_parts(
27135 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27139 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27141 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27143 float denom = b.real * b.real + b.imag * b.imag;
27144 return __pyx_t_float_complex_from_parts(
27145 (a.real * b.real + a.imag * b.imag) / denom,
27146 (a.imag * b.real - a.real * b.imag) / denom);
27150 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27151 __pyx_t_float_complex z;
27156 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27157 return (a.real == 0) && (a.imag == 0);
27159 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27160 __pyx_t_float_complex z;
27166 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex z) {
27167 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) 27168 return sqrtf(z.real*z.real + z.imag*z.imag);
27170 return hypotf(z.real, z.imag);
27173 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27174 __pyx_t_float_complex z;
27175 float r, lnr, theta, z_r, z_theta;
27176 if (b.imag == 0 && b.real == (
int)b.real) {
27178 float denom = a.real * a.real + a.imag * a.imag;
27179 a.real = a.real / denom;
27180 a.imag = -a.imag / denom;
27183 switch ((
int)b.real) {
27191 z = __Pyx_c_prod_float(a, a);
27192 return __Pyx_c_prod_float(a, a);
27194 z = __Pyx_c_prod_float(a, a);
27195 return __Pyx_c_prod_float(z, a);
27197 z = __Pyx_c_prod_float(a, a);
27198 return __Pyx_c_prod_float(z, z);
27204 }
else if (b.imag == 0) {
27205 z.real = powf(a.real, b.real);
27208 }
else if (a.real > 0) {
27213 theta = atan2f(0, -1);
27216 r = __Pyx_c_abs_float(a);
27217 theta = atan2f(a.imag, a.real);
27220 z_r = expf(lnr * b.real - theta * b.imag);
27221 z_theta = theta * b.real + lnr * b.imag;
27222 z.real = z_r * cosf(z_theta);
27223 z.imag = z_r * sinf(z_theta);
27230 #if CYTHON_CCOMPLEX 27232 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27233 return ::std::complex< double >(x, y);
27236 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27237 return x + y*(__pyx_t_double_complex)_Complex_I;
27241 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27242 __pyx_t_double_complex z;
27250 #if CYTHON_CCOMPLEX 27252 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27253 return (a.real == b.real) && (a.imag == b.imag);
27255 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27256 __pyx_t_double_complex z;
27257 z.real = a.real + b.real;
27258 z.imag = a.imag + b.imag;
27261 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27262 __pyx_t_double_complex z;
27263 z.real = a.real - b.real;
27264 z.imag = a.imag - b.imag;
27267 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27268 __pyx_t_double_complex z;
27269 z.real = a.real * b.real - a.imag * b.imag;
27270 z.imag = a.real * b.imag + a.imag * b.real;
27274 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27276 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27277 }
else if (fabs(b.real) >= fabs(b.imag)) {
27278 if (b.real == 0 && b.imag == 0) {
27279 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27281 double r = b.imag / b.real;
27282 double s = 1.0 / (b.real + b.imag * r);
27283 return __pyx_t_double_complex_from_parts(
27284 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27287 double r = b.real / b.imag;
27288 double s = 1.0 / (b.imag + b.real * r);
27289 return __pyx_t_double_complex_from_parts(
27290 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27294 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27296 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27298 double denom = b.real * b.real + b.imag * b.imag;
27299 return __pyx_t_double_complex_from_parts(
27300 (a.real * b.real + a.imag * b.imag) / denom,
27301 (a.imag * b.real - a.real * b.imag) / denom);
27305 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27306 __pyx_t_double_complex z;
27311 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27312 return (a.real == 0) && (a.imag == 0);
27314 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27315 __pyx_t_double_complex z;
27321 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27322 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) 27323 return sqrt(z.real*z.real + z.imag*z.imag);
27325 return hypot(z.real, z.imag);
27328 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27329 __pyx_t_double_complex z;
27330 double r, lnr, theta, z_r, z_theta;
27331 if (b.imag == 0 && b.real == (
int)b.real) {
27333 double denom = a.real * a.real + a.imag * a.imag;
27334 a.real = a.real / denom;
27335 a.imag = -a.imag / denom;
27338 switch ((
int)b.real) {
27346 z = __Pyx_c_prod_double(a, a);
27347 return __Pyx_c_prod_double(a, a);
27349 z = __Pyx_c_prod_double(a, a);
27350 return __Pyx_c_prod_double(z, a);
27352 z = __Pyx_c_prod_double(a, a);
27353 return __Pyx_c_prod_double(z, z);
27359 }
else if (b.imag == 0) {
27360 z.real = pow(a.real, b.real);
27363 }
else if (a.real > 0) {
27368 theta = atan2(0, -1);
27371 r = __Pyx_c_abs_double(a);
27372 theta = atan2(a.imag, a.real);
27375 z_r = exp(lnr * b.real - theta * b.imag);
27376 z_theta = theta * b.real + lnr * b.imag;
27377 z.real = z_r * cos(z_theta);
27378 z.imag = z_r * sin(z_theta);
27385 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
27386 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) -1, const_zero = (
enum NPY_TYPES) 0;
27387 const int is_unsigned = neg_one > const_zero;
27389 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
27390 return PyInt_FromLong((
long) value);
27391 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
27392 return PyLong_FromUnsignedLong((
unsigned long) value);
27393 #ifdef HAVE_LONG_LONG 27394 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
27395 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27399 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
27400 return PyInt_FromLong((
long) value);
27401 #ifdef HAVE_LONG_LONG 27402 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
27403 return PyLong_FromLongLong((PY_LONG_LONG) value);
27408 int one = 1;
int little = (int)*(
unsigned char *)&one;
27409 unsigned char *bytes = (
unsigned char *)&value;
27410 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
27411 little, !is_unsigned);
27416 static __Pyx_memviewslice
27417 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
27418 const char *mode,
int ndim,
27419 size_t sizeof_dtype,
int contig_flag,
27420 int dtype_is_object)
27422 __Pyx_RefNannyDeclarations
27424 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27425 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27426 Py_buffer *buf = &from_memview->view;
27427 PyObject *shape_tuple = NULL;
27428 PyObject *temp_int = NULL;
27429 struct __pyx_array_obj *array_obj = NULL;
27430 struct __pyx_memoryview_obj *memview_obj = NULL;
27431 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
27432 for (i = 0; i < ndim; i++) {
27433 if (from_mvs->suboffsets[i] >= 0) {
27434 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with " 27435 "indirect dimensions (axis %d)", i);
27439 shape_tuple = PyTuple_New(ndim);
27440 if (unlikely(!shape_tuple)) {
27443 __Pyx_GOTREF(shape_tuple);
27444 for(i = 0; i < ndim; i++) {
27445 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27446 if(unlikely(!temp_int)) {
27449 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27453 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
27454 if (unlikely(!array_obj)) {
27457 __Pyx_GOTREF(array_obj);
27458 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27459 (PyObject *) array_obj, contig_flag,
27461 from_mvs->memview->typeinfo);
27462 if (unlikely(!memview_obj))
27464 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27466 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27467 dtype_is_object) < 0))
27471 __Pyx_XDECREF(new_mvs.memview);
27472 new_mvs.memview = NULL;
27473 new_mvs.data = NULL;
27475 __Pyx_XDECREF(shape_tuple);
27476 __Pyx_XDECREF(temp_int);
27477 __Pyx_XDECREF(array_obj);
27478 __Pyx_RefNannyFinishContext();
27483 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
27484 const int neg_one = (int) -1, const_zero = (
int) 0;
27485 const int is_unsigned = neg_one > const_zero;
27486 #if PY_MAJOR_VERSION < 3 27487 if (likely(PyInt_Check(x))) {
27488 if (
sizeof(
int) <
sizeof(long)) {
27489 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
27491 long val = PyInt_AS_LONG(x);
27492 if (is_unsigned && unlikely(val < 0)) {
27493 goto raise_neg_overflow;
27499 if (likely(PyLong_Check(x))) {
27501 #if CYTHON_USE_PYLONG_INTERNALS 27502 const digit* digits = ((PyLongObject*)x)->ob_digit;
27503 switch (Py_SIZE(x)) {
27504 case 0:
return (
int) 0;
27505 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
27507 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27508 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27509 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27510 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
27511 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27516 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27517 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27518 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27519 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
27520 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27525 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27526 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27527 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27528 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
27529 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27535 #if CYTHON_COMPILING_IN_CPYTHON 27536 if (unlikely(Py_SIZE(x) < 0)) {
27537 goto raise_neg_overflow;
27541 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27542 if (unlikely(result < 0))
27544 if (unlikely(result == 1))
27545 goto raise_neg_overflow;
27548 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27549 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
27550 #ifdef HAVE_LONG_LONG 27551 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27552 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27556 #if CYTHON_USE_PYLONG_INTERNALS 27557 const digit* digits = ((PyLongObject*)x)->ob_digit;
27558 switch (Py_SIZE(x)) {
27559 case 0:
return (
int) 0;
27560 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
27561 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
27563 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
27564 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27565 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27566 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27567 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27572 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27573 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27574 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27575 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27576 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27581 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27582 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27583 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27584 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27585 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27590 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27591 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27592 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27593 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27594 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27599 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27600 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27601 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27602 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27603 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27608 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27609 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27610 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27611 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27612 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27618 if (
sizeof(
int) <=
sizeof(long)) {
27619 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
27620 #ifdef HAVE_LONG_LONG 27621 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27622 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
27627 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 27628 PyErr_SetString(PyExc_RuntimeError,
27629 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27632 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27633 #if PY_MAJOR_VERSION < 3 27634 if (likely(v) && !PyLong_Check(v)) {
27636 v = PyNumber_Long(tmp);
27641 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27642 unsigned char *bytes = (
unsigned char *)&val;
27643 int ret = _PyLong_AsByteArray((PyLongObject *)v,
27644 bytes,
sizeof(val),
27645 is_little, !is_unsigned);
27655 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27656 if (!tmp)
return (
int) -1;
27657 val = __Pyx_PyInt_As_int(tmp);
27662 PyErr_SetString(PyExc_OverflowError,
27663 "value too large to convert to int");
27665 raise_neg_overflow:
27666 PyErr_SetString(PyExc_OverflowError,
27667 "can't convert negative value to int");
27672 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
27673 const long neg_one = (long) -1, const_zero = (
long) 0;
27674 const int is_unsigned = neg_one > const_zero;
27675 #if PY_MAJOR_VERSION < 3 27676 if (likely(PyInt_Check(x))) {
27677 if (
sizeof(
long) <
sizeof(long)) {
27678 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
27680 long val = PyInt_AS_LONG(x);
27681 if (is_unsigned && unlikely(val < 0)) {
27682 goto raise_neg_overflow;
27688 if (likely(PyLong_Check(x))) {
27690 #if CYTHON_USE_PYLONG_INTERNALS 27691 const digit* digits = ((PyLongObject*)x)->ob_digit;
27692 switch (Py_SIZE(x)) {
27693 case 0:
return (
long) 0;
27694 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
27696 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27697 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27698 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27699 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
27700 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
27705 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27706 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27707 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27708 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
27709 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27714 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27715 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27716 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27717 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
27718 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
27724 #if CYTHON_COMPILING_IN_CPYTHON 27725 if (unlikely(Py_SIZE(x) < 0)) {
27726 goto raise_neg_overflow;
27730 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27731 if (unlikely(result < 0))
27733 if (unlikely(result == 1))
27734 goto raise_neg_overflow;
27737 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27738 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
27739 #ifdef HAVE_LONG_LONG 27740 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27741 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27745 #if CYTHON_USE_PYLONG_INTERNALS 27746 const digit* digits = ((PyLongObject*)x)->ob_digit;
27747 switch (Py_SIZE(x)) {
27748 case 0:
return (
long) 0;
27749 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
27750 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
27752 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
27753 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27754 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27755 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27756 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27761 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27762 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27763 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27764 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27765 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27770 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27771 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27772 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27773 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27774 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27779 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27780 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27781 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27782 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27783 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27788 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27789 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27790 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27791 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27792 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27797 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27798 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27799 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27800 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27801 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27807 if (
sizeof(
long) <=
sizeof(long)) {
27808 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
27809 #ifdef HAVE_LONG_LONG 27810 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27811 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
27816 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 27817 PyErr_SetString(PyExc_RuntimeError,
27818 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27821 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27822 #if PY_MAJOR_VERSION < 3 27823 if (likely(v) && !PyLong_Check(v)) {
27825 v = PyNumber_Long(tmp);
27830 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27831 unsigned char *bytes = (
unsigned char *)&val;
27832 int ret = _PyLong_AsByteArray((PyLongObject *)v,
27833 bytes,
sizeof(val),
27834 is_little, !is_unsigned);
27844 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27845 if (!tmp)
return (
long) -1;
27846 val = __Pyx_PyInt_As_long(tmp);
27851 PyErr_SetString(PyExc_OverflowError,
27852 "value too large to convert to long");
27854 raise_neg_overflow:
27855 PyErr_SetString(PyExc_OverflowError,
27856 "can't convert negative value to long");
27861 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
27862 const char neg_one = (char) -1, const_zero = (
char) 0;
27863 const int is_unsigned = neg_one > const_zero;
27864 #if PY_MAJOR_VERSION < 3 27865 if (likely(PyInt_Check(x))) {
27866 if (
sizeof(
char) <
sizeof(long)) {
27867 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
27869 long val = PyInt_AS_LONG(x);
27870 if (is_unsigned && unlikely(val < 0)) {
27871 goto raise_neg_overflow;
27877 if (likely(PyLong_Check(x))) {
27879 #if CYTHON_USE_PYLONG_INTERNALS 27880 const digit* digits = ((PyLongObject*)x)->ob_digit;
27881 switch (Py_SIZE(x)) {
27882 case 0:
return (
char) 0;
27883 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
27885 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
27886 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27887 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27888 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
27889 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
27894 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
27895 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27896 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27897 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
27898 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27903 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
27904 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27905 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27906 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
27907 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
27913 #if CYTHON_COMPILING_IN_CPYTHON 27914 if (unlikely(Py_SIZE(x) < 0)) {
27915 goto raise_neg_overflow;
27919 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27920 if (unlikely(result < 0))
27922 if (unlikely(result == 1))
27923 goto raise_neg_overflow;
27926 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
27927 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
27928 #ifdef HAVE_LONG_LONG 27929 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
27930 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27934 #if CYTHON_USE_PYLONG_INTERNALS 27935 const digit* digits = ((PyLongObject*)x)->ob_digit;
27936 switch (Py_SIZE(x)) {
27937 case 0:
return (
char) 0;
27938 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
27939 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
27941 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
27942 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27943 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27944 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27945 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27950 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
27951 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27952 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27953 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27954 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27959 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27960 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27961 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27962 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27963 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27968 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
27969 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27970 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27971 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27972 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27977 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27978 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27979 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27980 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
27981 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27986 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
27987 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27988 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27989 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
27990 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27996 if (
sizeof(
char) <=
sizeof(long)) {
27997 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
27998 #ifdef HAVE_LONG_LONG 27999 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
28000 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28005 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 28006 PyErr_SetString(PyExc_RuntimeError,
28007 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28010 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28011 #if PY_MAJOR_VERSION < 3 28012 if (likely(v) && !PyLong_Check(v)) {
28014 v = PyNumber_Long(tmp);
28019 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28020 unsigned char *bytes = (
unsigned char *)&val;
28021 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28022 bytes,
sizeof(val),
28023 is_little, !is_unsigned);
28033 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28034 if (!tmp)
return (
char) -1;
28035 val = __Pyx_PyInt_As_char(tmp);
28040 PyErr_SetString(PyExc_OverflowError,
28041 "value too large to convert to char");
28043 raise_neg_overflow:
28044 PyErr_SetString(PyExc_OverflowError,
28045 "can't convert negative value to char");
28050 static int __Pyx_check_binary_version(
void) {
28051 char ctversion[4], rtversion[4];
28052 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28053 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
28054 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28056 PyOS_snprintf(message,
sizeof(message),
28057 "compiletime version %s of module '%.100s' " 28058 "does not match runtime version %s",
28059 ctversion, __Pyx_MODULE_NAME, rtversion);
28060 return PyErr_WarnEx(NULL, message, 1);
28066 #ifndef __PYX_HAVE_RT_ImportModule 28067 #define __PYX_HAVE_RT_ImportModule 28068 static PyObject *__Pyx_ImportModule(
const char *name) {
28069 PyObject *py_name = 0;
28070 PyObject *py_module = 0;
28071 py_name = __Pyx_PyIdentifier_FromString(name);
28074 py_module = PyImport_Import(py_name);
28075 Py_DECREF(py_name);
28078 Py_XDECREF(py_name);
28084 #ifndef __PYX_HAVE_RT_ImportType 28085 #define __PYX_HAVE_RT_ImportType 28086 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
28087 size_t size,
int strict)
28089 PyObject *py_module = 0;
28090 PyObject *result = 0;
28091 PyObject *py_name = 0;
28093 Py_ssize_t basicsize;
28094 #ifdef Py_LIMITED_API 28095 PyObject *py_basicsize;
28097 py_module = __Pyx_ImportModule(module_name);
28100 py_name = __Pyx_PyIdentifier_FromString(class_name);
28103 result = PyObject_GetAttr(py_module, py_name);
28104 Py_DECREF(py_name);
28106 Py_DECREF(py_module);
28110 if (!PyType_Check(result)) {
28111 PyErr_Format(PyExc_TypeError,
28112 "%.200s.%.200s is not a type object",
28113 module_name, class_name);
28116 #ifndef Py_LIMITED_API 28117 basicsize = ((PyTypeObject *)result)->tp_basicsize;
28119 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
28122 basicsize = PyLong_AsSsize_t(py_basicsize);
28123 Py_DECREF(py_basicsize);
28125 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
28128 if (!strict && (
size_t)basicsize > size) {
28129 PyOS_snprintf(warning,
sizeof(warning),
28130 "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
28131 module_name, class_name, basicsize, size);
28132 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
28134 else if ((
size_t)basicsize != size) {
28135 PyErr_Format(PyExc_ValueError,
28136 "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
28137 module_name, class_name, basicsize, size);
28140 return (PyTypeObject *)result;
28142 Py_XDECREF(py_module);
28143 Py_XDECREF(result);
28149 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28151 #if PY_MAJOR_VERSION < 3 28152 if (t->is_unicode) {
28153 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28154 }
else if (t->intern) {
28155 *t->p = PyString_InternFromString(t->s);
28157 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28160 if (t->is_unicode | t->is_str) {
28162 *t->p = PyUnicode_InternFromString(t->s);
28163 }
else if (t->encoding) {
28164 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28166 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28169 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28174 if (PyObject_Hash(*t->p) == -1)
28181 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
28182 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28184 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
28186 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28188 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 28189 #if !CYTHON_PEP393_ENABLED 28190 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28192 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28193 if (!defenc)
return NULL;
28194 defenc_c = PyBytes_AS_STRING(defenc);
28195 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 28197 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28199 for (c = defenc_c; c < end; c++) {
28200 if ((
unsigned char) (*c) >= 128) {
28201 PyUnicode_AsASCIIString(o);
28207 *length = PyBytes_GET_SIZE(defenc);
28211 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28212 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
28213 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 28214 if (likely(PyUnicode_IS_ASCII(o))) {
28215 *length = PyUnicode_GET_LENGTH(o);
28216 return PyUnicode_AsUTF8(o);
28218 PyUnicode_AsASCIIString(o);
28222 return PyUnicode_AsUTF8AndSize(o, length);
28227 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28228 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 28230 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28231 __Pyx_sys_getdefaultencoding_not_ascii &&
28233 PyUnicode_Check(o)) {
28234 return __Pyx_PyUnicode_AsStringAndSize(o, length);
28237 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 28238 if (PyByteArray_Check(o)) {
28239 *length = PyByteArray_GET_SIZE(o);
28240 return PyByteArray_AS_STRING(o);
28245 int r = PyBytes_AsStringAndSize(o, &result, length);
28246 if (unlikely(r < 0)) {
28253 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
28254 int is_true = x == Py_True;
28255 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
28256 else return PyObject_IsTrue(x);
28258 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
28259 #if PY_MAJOR_VERSION >= 3 28260 if (PyLong_Check(result)) {
28261 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28262 "__int__ returned non-int (type %.200s). " 28263 "The ability to return an instance of a strict subclass of int " 28264 "is deprecated, and may be removed in a future version of Python.",
28265 Py_TYPE(result)->tp_name)) {
28272 PyErr_Format(PyExc_TypeError,
28273 "__%.4s__ returned non-%.4s (type %.200s)",
28274 type_name, type_name, Py_TYPE(result)->tp_name);
28278 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28279 #if CYTHON_USE_TYPE_SLOTS 28280 PyNumberMethods *m;
28282 const char *name = NULL;
28283 PyObject *res = NULL;
28284 #if PY_MAJOR_VERSION < 3 28285 if (likely(PyInt_Check(x) || PyLong_Check(x)))
28287 if (likely(PyLong_Check(x)))
28289 return __Pyx_NewRef(x);
28290 #if CYTHON_USE_TYPE_SLOTS 28291 m = Py_TYPE(x)->tp_as_number;
28292 #if PY_MAJOR_VERSION < 3 28293 if (m && m->nb_int) {
28295 res = m->nb_int(x);
28297 else if (m && m->nb_long) {
28299 res = m->nb_long(x);
28302 if (likely(m && m->nb_int)) {
28304 res = m->nb_int(x);
28308 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28309 res = PyNumber_Int(x);
28313 #if PY_MAJOR_VERSION < 3 28314 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28316 if (unlikely(!PyLong_CheckExact(res))) {
28318 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28321 else if (!PyErr_Occurred()) {
28322 PyErr_SetString(PyExc_TypeError,
28323 "an integer is required");
28327 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28330 #if PY_MAJOR_VERSION < 3 28331 if (likely(PyInt_CheckExact(b))) {
28332 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
28333 return PyInt_AS_LONG(b);
28335 return PyInt_AsSsize_t(x);
28338 if (likely(PyLong_CheckExact(b))) {
28339 #if CYTHON_USE_PYLONG_INTERNALS 28340 const digit* digits = ((PyLongObject*)b)->ob_digit;
28341 const Py_ssize_t size = Py_SIZE(b);
28342 if (likely(__Pyx_sst_abs(size) <= 1)) {
28343 ival = likely(size) ? digits[0] : 0;
28344 if (size == -1) ival = -ival;
28349 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28350 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28354 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28355 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28359 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28360 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28364 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28365 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28369 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28370 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28374 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28375 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28381 return PyLong_AsSsize_t(b);
28383 x = PyNumber_Index(b);
28385 ival = PyInt_AsSsize_t(x);
28389 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
28390 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28392 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
28393 return PyInt_FromSize_t(ival);
double f(double C, double b, double a, int q, int r)